thinking about how many platforms need to be changed every time we update something about how hosts work (e.g. Folkert's calling convention improvement), or we're about to need roc_dbg
for dbg
to use Inspect
), it would be great if we reduced the quantity of different platforms in the repo that needed to be updated.
I think it makes sense to have:
examples/
examples/
that's specifically about platform switching (which also demonstrates how to get a platform locally instead of from a URL)what do others think?
Sounds good to me
I guess one note, changing to url platforms actually just makes things worse. They will break on these changes but be more work/delay to update.
true, but we have to do the same amount of work to fix those anyway :big_smile:
Well, we just can't block merging on the examples passing. Because otherwise we can't make a compiler change that changes the platform API while still having examples with old platforms passing.
Yeah, but now they are scattered and need a release process instead of just direct changes in the roc repo
Wouldn't it make more sense to put all that common code into a shared directory in the repo?
One Zig file and one Rust crate that all the hosts can import and re-export.
Zig and Rust both have their own mechanisms for sharing code. It doesn't have to be a Roc-specific mechanism.
Then we can also make slight differences between the platforms where needed. And we can still make atomic commits to upgrade everything at once.
Did we resolve a plan here? I'm not sure if we settled on a decision with this discussion?
Another idea, what about moving the platforms to https://github.com/roc-lang/examples/tree/main and making a platforms folder there? We can include a README which explains more about these. Do we need any of the current examples for tests?
With this idea we could remove examples entirely or leave a README pointing to the repository.
This might make upgrades simpler as these platforms might fall behind, but they wont hold up CI on roc, and can be update in a follow-up PR on the example repository.
I think it definitely makes sense to move all the other language examples (ruby, python, java...) to the examples repo. Perhaps we should keep nodejs-interop in the main repo @Richard Feldman?
Last updated: Jul 06 2025 at 12:14 UTC