I am planning to write my own platform in Rust. I cannot find any documentation on how to do it. Taking a look at basic-cli
is also really confusing. Nested ROC and Rust files. Glue code that is generated automatically, but nowhere is mentioned how it is generated.
roc glue
and roc gen-glue-lib
exist, but take some files as input that I have no idea what they are.
It seems most operations with effects are inside the Effect.roc
file. generates Effect with [after, map, always, forever, loop]
seems to generate a struct/type but it's nowhere to be found. And the tutorial never mentions anything about the generates
keyword.
Is there like a short tutorial on how to do this?
I have a PR I've been working on but haven't touched much lately to cleanup glue gen for basic-cli so you can just run a script. At the moment it is a fair mess because it's usually the first platform to get features (written by hand) and then the tooling and infrastructure catches up. If you checkout basic-webserver that has a nicer glue setup. But note there are still some issues with glue which mean we have some workarounds to make it work. So it's definitely do-able rn, but I wouldn't suggest it's easy.
Documentation for platforms hasn't been written yet, there is still a lot going on in that space and so it would be a challenge to keep it up to date.
@Brendan Hansknecht done a few streams which go into detail about these things, and he explains along the way.
https://roc.zulipchat.com/#narrow/stream/316715-contributing/topic/Streaming.20Roc.20Development
@Luke Boswell I wouldn't mind having to dig into platforms and figure out how they work if the glue mechanism worked. But having to manually write glue definitions without internal knowledge seems challenging. Sure, I can eventually figure it out, but it takes time I'm not willing to spend right now.
I'll skip roc for now. It seemed like the perfect language/runtime for my project though...
Thanks though, it is a super interesting project! I'll keep an eye on it :)
6 messages were moved here from #beginners > Tasks and Error handling by Luke Boswell.
mainrs said:
I'll skip roc for now. It seemed like the perfect language/runtime for my project though...
Thanks though, it is a super interesting project! I'll keep an eye on it :)
yeah I'd say check back maybe like mid-2024...platform development is pretty rough right now - we've made a bunch of investments in it, but we're only partway to a smooth experience there for sure :big_smile:
thanks for checking it out, and hopefully it'll be a lot more solid when you check back!
Last updated: Jul 05 2025 at 12:14 UTC