Stream: ideas

Topic: Playground - platform information


view this post on Zulip souf (Sep 29 2025 at 12:47):

At the moment the playground is using the platform:

app [main!] { pf: platform "../basic-cli/platform.roc" }

I haven't explored much about platforms in Roc yet, but my understanding is that the platform is kind of the public api/std lib you have access to in that program. Right?

In that case the required platform is relative to the file (../), and there are no ways to see what's the API of that platform.

Maybe it would be beneficial to have a panel to display the available platforms on the playground (if ever there are many) and display its public API directly in the playground?

If I'm mistaken about what a platform is, that idea might be irrelevant, but still it might be good to make things clear for a "TLDR"-newcomer who just wants to play with the language to discover its syntax.

view this post on Zulip Anton (Sep 29 2025 at 12:57):

This is the best explanation about what a platform is: https://roc-lang.org/platforms

view this post on Zulip Anton (Sep 29 2025 at 12:58):

In that case the required platform is relative to the file (../), and there are no ways to see what's the API of that platform.

This will probably be changed to a URL for the production Roc plaground.

view this post on Zulip Anton (Sep 29 2025 at 12:59):

Maybe it would be beneficial to have a panel to display the available platforms on the playground (if ever there are many) and display its public API directly in the playground?

We will probably stick with a single platform for a while, but yeah, once we have a working non-trivial platform in the playground we should provide links to the docs.

view this post on Zulip souf (Sep 29 2025 at 13:00):

Yes I scanned that doc quickly. My understanding is that each platform exposes its own specific functions, right?

view this post on Zulip Anton (Sep 29 2025 at 13:01):

Yes, that's correct.

view this post on Zulip souf (Sep 29 2025 at 13:02):

Do you think it would be beneficial that the playground "scans" the platform and lists the available functions (and other items if there are more than just functions) directly in a dedicated panel within the playground?

view this post on Zulip Anton (Sep 29 2025 at 13:03):

Hmm, I don't know... I feel like the docs websites work pretty well for that purpose, like https://roc-lang.github.io/basic-cli/0.20.0/

view this post on Zulip Anton (Sep 29 2025 at 13:05):

Maybe we have enough real estate in the playground to display the docs website next to it with an iframe

view this post on Zulip Tobias Steckenborn (Sep 29 2025 at 14:00):

Or a simple
CleanShot 2025-09-29 at 15.59.32.png

view this post on Zulip Luke Boswell (Sep 29 2025 at 22:55):

Presently, the playground doesn't support multiple roc modules -- so the platform in the app header isn't doing anything right now. It currently just compiles a single file -- and we simulate other modules like the builtins. It's on the near roadmap to start using the BuildEnv and support building multiple modules.

view this post on Zulip Luke Boswell (Sep 29 2025 at 22:57):

I had a crack at adding support for multiple modules, but went down a massive rabbit hole with the builtins. It's a big cross cutting thing and I never managed to really land anything useful.

view this post on Zulip Luke Boswell (Sep 29 2025 at 22:57):

I'm hoping the latest Richard-Jared collaboration on type system and interpreter fixes will make this much easier to support.

view this post on Zulip Luke Boswell (Sep 29 2025 at 22:59):

For the playground specifically... I was thinking of having a simple platform that had some simple drawing effects to work with a canvas. I have fond memories of something like that from my early experience learning Elm.

Longer term we can probably support more exotic platforms in the playground, but I'm not really sure how that will look yet. Lot's of exploration and experimentation in that space.


Last updated: Jun 16 2026 at 16:19 UTC