Hello to everyone,
Just completed my local build of ROC basic webserver and everything went well .
But the line " Updating crates.io index " worries me a bit as I do not know much about Rust even I know I installed it some time back playing around with it a bit.
So I m still wondering how Rust and ROC are related
Do understand from some videos from Richard Feldman that ROC compiler was done in Rust
But is there any document about it ( Rust ) and why Static Dispatch was picked ( for ROC )
Thanks in advance for any feedback
Best regards
Gottfried
The roc compiler was original written in rust, but is currently in the process of being rewritten into zig.
If you build basic webserver from source, the actually webserver platform is written in rust. In roc all applications are built on top of a platform. The platforms are generally written in rust or zig, but could be written in any language that can speak c ffi (which is essentially all languages)
This talks about some of the reasons for the switch to zig for the compiler: https://gist.github.com/rtfeldman/77fb430ee57b42f5f2ca973a3992532f
This talks about the concept of platforms in general: https://www.roc-lang.org/platforms
Static dispatch is more complicated to explain the why of (it came out of a lot of discussion and history). Fundamentally, for roc we wanted to enable more powerful interfaces. This was originally done via abilities. Abilities were complex and often felt like they didn't quite fit the language. Static dispatch is a simple and direct way to enable nicer syntax with interfaces, but avoidost of the complexity.
Original static dispatch proposal: https://roc.zulipchat.com/#narrow/stream/304641-ideas/topic/static.20dispatch.20-.20proposal/near/481417068
Also, just to state this explicitly, static dispatch and rust have no relation to each other
@Brendan Hansknecht Thanks for detailed explanation even if I m more confused now like before . ROC,Rust,zig, C FFI .What a mess . Just wanted to compare ROC with Gleam or ( and ) Haskell as Pure Functional Paradigm is a very powerful concept
@Gottfried Zojer Just focus on the concept of Platforms and you’ll get rolling: https://www.roc-lang.org/platforms
I recommend picking a platform and writing a bit of Roc to get a hang of it. Everything will unfold nicely from there :ok:
Roc is in the middle of a compiler rewrite and some large changes to the language are happening. You could either wait for that to land (it may be ready for Advent of Code!) or you just jump in now and grok the new syntax as it arrives (that’s what I’m doing :))
@Niclas Ahden Also thanks to you for your clarification . And dont worry about me. Been seasoned enough to understand ( completed first C++ project when Windows 95 was still a beta version ) . Not exactly yesterday but still pretty cool when looking at specs from most recent CPU s ( AMD Ryzen 9 5950X) with 16 cores as example
Sweet! I hope you’ll enjoy Roc :)
Gottfried Zojer said:
ROC,Rust,zig, C FFI .What a mess . Just wanted to compare ROC with Gleam or ( and ) Haskell as Pure Functional Paradigm is a very powerful concept
Yeah, roc platforms add a lot of extra complexity (and potential) compared to other similar languages. And our overall documentation and tutorial state is kinda rough right now.
I would try to start by ignoring platforms. Just build on top of basic webserver or basic cli
ROC,Rust,zig, C FFI .What a mess . Just wanted to compare ROC with Gleam
@Gottfried Zojer to clear things up, we don't intend for the majority of users to use or need to know about Rust, zig or C FFI.
For your comparison you can try roc build --optimize my-webserver.roc --linker=legacy
with the pre-built basic-webserver 0.12.0 release (example). Here are some more notes on benchmarking for when you don't want to benchmark with multiple machines.
Feel free to let us know if you hit any problems.
@Anton No worries everything is working fine
Last updated: Jul 06 2025 at 12:14 UTC