Stream: contributing

Topic: fewer custom platforms in the repo


view this post on Zulip Richard Feldman (Nov 27 2023 at 17:57):

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:

view this post on Zulip Richard Feldman (Nov 27 2023 at 17:57):

what do others think?

view this post on Zulip Ayaz Hafiz (Nov 27 2023 at 18:02):

Sounds good to me

view this post on Zulip Brendan Hansknecht (Nov 27 2023 at 18:04):

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.

view this post on Zulip Richard Feldman (Nov 27 2023 at 18:07):

true, but we have to do the same amount of work to fix those anyway :big_smile:

view this post on Zulip Ayaz Hafiz (Nov 27 2023 at 18:09):

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.

view this post on Zulip Brendan Hansknecht (Nov 27 2023 at 18:09):

Yeah, but now they are scattered and need a release process instead of just direct changes in the roc repo

view this post on Zulip Brian Carroll (Nov 27 2023 at 20:32):

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.

view this post on Zulip Luke Boswell (Nov 28 2023 at 23:44):

Did we resolve a plan here? I'm not sure if we settled on a decision with this discussion?

view this post on Zulip Luke Boswell (Nov 28 2023 at 23:46):

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?

view this post on Zulip Luke Boswell (Nov 28 2023 at 23:47):

With this idea we could remove examples entirely or leave a README pointing to the repository.

view this post on Zulip Luke Boswell (Nov 28 2023 at 23:48):

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.

view this post on Zulip Anton (Nov 29 2023 at 09:57):

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