Stream: beginners

Topic: Platform Composability?


view this post on Zulip Daniel Dombrowsky (Sep 29 2026 at 22:48):

Hey there. Just starting out writing some roc and starting to write a platform in Rust. Just curious, are there any thoughts/plans on composing platforms? I'm doing some networking things and realizing I also want cli stuff. Feels like in my dream world I would be able to pull in basic_cli to do cli things and my own networking thing to do networking things.

I'm aware I could "compose" things on the platform side in the platform language, just thinking I would like to do it on the Roc side.

Edit: I guess after reading https://github.com/roc-lang/roc/blob/main/docs/mini-tutorial-new-compiler.md
it's clear the intent is exactly one platform, no combining multiple. Leaving this topic here just for additional discussion.

view this post on Zulip Richard Feldman (Sep 29 2026 at 23:21):

welcome @Daniel Dombrowsky! :smiley:

view this post on Zulip Richard Feldman (Sep 29 2026 at 23:22):

you're far from alone in asking this question! It's one of the most-discussed topics on Zulip and we have a FAQ entry for it too

view this post on Zulip Daniel Dombrowsky (Sep 30 2026 at 01:37):

Thanks for the link, makes sense. One of the things drawing me in is that I think the platform concept is cool and unique. So it tracks that like so many things there's a tradeoff.

view this post on Zulip notramo (Sep 30 2026 at 02:04):

The ideal thing would be that platforms only provide basic functionality like file/socket I/O and concurrency (scheduling, messaging), and everything on top is written in Roc in a platform-agnostic way.

view this post on Zulip notramo (Sep 30 2026 at 02:04):

If we had a platform agnostic Roc HTTP library, that could be used with a simple socket in basic-cli, but also with any other platform that provides socket primitives.

view this post on Zulip notramo (Sep 30 2026 at 02:05):

The current basic-webserver does the HTTP in Rust, that's why it's not composable.

view this post on Zulip notramo (Sep 30 2026 at 02:06):

However, for native Roc features to work, concurrency is required in many cases (for example, to handle multiple requests concurrently in a pure Roc HTTP library). There is no full-featured concurrency in any platform currently.

view this post on Zulip notramo (Sep 30 2026 at 02:07):

#ideas > Concurrent/threaded platforms

view this post on Zulip notramo (Sep 30 2026 at 02:08):

It's being explored, but it needs work.

view this post on Zulip notramo (Sep 30 2026 at 02:10):

Platforms are not just a simple FFI alternative, but much more. Different platforms can implement different styles of I/O, concurrency, memory management, etc.

view this post on Zulip notramo (Sep 30 2026 at 02:11):

It doesn't help if two platform components are both written in Zig if they use different memory management and I/O practices. It's not only about the language.

view this post on Zulip notramo (Sep 30 2026 at 02:15):

I think of platforms like if they are like libc for C.

view this post on Zulip notramo (Sep 30 2026 at 02:16):

Of course, if Roc is used e.g. as an extension language for a game or an editor, the platform has the main functionality, and Roc is just a small part.

view this post on Zulip notramo (Sep 30 2026 at 02:17):

But an extension environment requires different Roc packages than a whole app or a server.

view this post on Zulip Richard Feldman (Sep 30 2026 at 02:29):

notramo said:

I think of platforms like if they are like libc for C.

this is one way to think of them, but there are many others! :smile:

view this post on Zulip Richard Feldman (Sep 30 2026 at 02:29):

e.g. game engine platform

view this post on Zulip Richard Feldman (Sep 30 2026 at 02:30):

or "your entire existing large app in another code base is the platform, and you just want to inject a bit of roc into it"

view this post on Zulip Richard Feldman (Sep 30 2026 at 02:31):

platforms can be all shapes and sizes

view this post on Zulip Steve Howell (Sep 30 2026 at 11:20):

#ideas > Platform extensibility using bundle of effects pattern @ 💬 is a related thread.


Last updated: Oct 15 2026 at 17:56 UTC