Stream: ideas

Topic: Playground enhancement for AoC?


view this post on Zulip Tobias Steckenborn (Sep 04 2025 at 06:50):

Given Luke was working on the playground, would it make sense to have an eye on getting also the playground in a state where perhaps sources can be easily shared for AoC?

Having a ready to run environment would likely reduce the friction and get more people to give it a spin and we could share solutions and somehow do a sort of review of interesting or recommended solutions?

(thinking out loud if e.g. somehow tests would work and be rendered in a tab in the sense of these ones fails and these ones succeed that could even serve as a sort of „do it yourself“ tutorial, where the tasks could be explained using predefined tests and a comment and if you get stuck you get linked to other solutions)

view this post on Zulip Anton (Sep 05 2025 at 09:40):

Hi Tobias,
The source code can currently be shared using the "share link" button, or did you have something else in mind?

view this post on Zulip Tobias Steckenborn (Sep 05 2025 at 11:19):

Ah, didn’t see that before. Are there any plans to support tests / a sort of test view in it as well?

view this post on Zulip Anton (Sep 05 2025 at 11:27):

No specific plans yet but I think it makes sense

view this post on Zulip Luke Boswell (Sep 05 2025 at 19:47):

Supporting tests should be very doable. We have everything we need wired up already. We also have roc test working. If anyone wants to implement this I'm happy to help.

view this post on Zulip Fabian Schmalzried (Sep 07 2025 at 22:31):

When I find time this week, I will have a look at it.

view this post on Zulip Fabian Schmalzried (Sep 11 2025 at 23:47):

@Luke Boswell Since you offered to help:

roc-lang/roc-playground#15 and roc-lang/roc#8244 show my first drafts. Is this going in the right direction?

Anyone has ideas for a good UI? Should the test results just be another tab, or a special area?

view this post on Zulip Tobias Steckenborn (Sep 11 2025 at 23:58):

I‘d say a tab with the tests and results would be a good first start. A long time stretch goal might be something in the direction of https://wallabyjs.com/docs/intro/standalone/ but that would be way more complex and likely something that should also then be provided by default not just in the playground (if at all something that’s being targeted by the „core“)

view this post on Zulip Tobias Steckenborn (Dec 31 2025 at 16:55):

Given all examples in the playground now display warnings or errors, would it somehow make sense to display somewhere in the playground on which version (or release / nightly) the playground runs (and eventually a comment in the samples for which version they were intended?)

view this post on Zulip Anton (Dec 31 2025 at 18:25):

Good idea, I made https://github.com/roc-lang/roc-playground/issues/21 for this.

view this post on Zulip Luke Boswell (Dec 31 2025 at 19:59):

It should display the version in a console.log when it loads I think. Also we should be able to update the Playground anytime with a new build, I keep forgetting. Just build it frok main branch and copy paste the playground.wasm into the the other repo.

view this post on Zulip Luke Boswell (Dec 31 2025 at 19:59):

We should probably automate that I think.

view this post on Zulip Anton (Jan 01 2026 at 12:30):

Luke Boswell said:

We should probably automate that I think.

I'll take care of that.

view this post on Zulip Anton (Jan 01 2026 at 15:21):

playground.wasm will be published (starting tomorrow) once a day alongside the nightly releases: https://github.com/roc-lang/nightlies/releases

view this post on Zulip Anton (Jan 05 2026 at 11:21):

I broke the playground, looking at it now...

view this post on Zulip Anton (Jan 05 2026 at 11:22):

Good time to try out the claude chrome extension

view this post on Zulip Anton (Jan 05 2026 at 13:02):

It works well, for others who are interested , these are the relevant docs: https://code.claude.com/docs/en/chrome

view this post on Zulip Anton (Jan 05 2026 at 19:06):

Anton said:

I broke the playground, looking at it now...

I've fixed a bunch of things but still have some flaky memory issues that I'm working on...

view this post on Zulip Tobias Steckenborn (Jan 06 2026 at 09:52):

Anything to check or support with?

view this post on Zulip Anton (Jan 06 2026 at 10:06):

Thanks, but I think I'm down to a final flaky memory issue. I will let you now when it is deployed and ready to test. This will likely be tomorrow because of the nightly playground.wasm build.

view this post on Zulip Anton (Jan 06 2026 at 18:05):

It's really easy to exceed the browser call stack size with Can.canonicalizeExpr. We've talked about fixing some deep recursion before. Did you happen to already have something planned for this @Richard Feldman?

view this post on Zulip Richard Feldman (Jan 06 2026 at 18:07):

yeah there are some parts of the code base that just need to be made non-recursive. usually Claude can do it, over the course of multiple attempts. :sweat_smile:

view this post on Zulip Anton (Jan 06 2026 at 18:15):

Hmm, with call stack truncation disabled for logging I see it's actually only 27 calls deep :thinking:
Will continue tomorrow...

view this post on Zulip Anton (Jan 07 2026 at 15:27):

The fix ended up being really simple :) zig build playground -Doptimize=ReleaseSmall

view this post on Zulip Tobias Steckenborn (Jan 07 2026 at 15:50):

Then likely released tomorrow? Shall I check and see if I can update the samples?

view this post on Zulip Anton (Jan 07 2026 at 15:51):

Then likely released tomorrow?

Yes

Shall I check and see if I can update the samples?

I already updated them locally :)

view this post on Zulip Anton (Jan 07 2026 at 15:52):

@Luke Boswell can https://github.com/lukewilliamboswell/roc-platform-template-zig be built for use with wasm?

view this post on Zulip Luke Boswell (Jan 07 2026 at 20:52):

Zig template doesn't currently build for Wasm target, the host would need to be modified to support that. What would Stdout.line! mean in freestanding wasm? maybe we could add wasi as a target.

We have a wasm test platfrom https://github.com/roc-lang/roc/tree/main/test/wasm

view this post on Zulip Anton (Jan 08 2026 at 09:32):

Yeah, using the wasm test platform probably makes the most sense

view this post on Zulip Tobias Steckenborn (Jan 08 2026 at 13:18):

Yeah, so we're now basically just missing some sort of input / output (or output for now, assuming hardcoded inputs)? So a sort of console / similar to the repl?

view this post on Zulip Anton (Jan 08 2026 at 14:27):

Uhu, console for output sounds good

view this post on Zulip Tobias Steckenborn (Jan 09 2026 at 07:51):

Naive question:

CleanShot 2026-01-09 at 08.50.08.png

Is the type for string supposed to be error? If not how to be investigate where the issue is?

view this post on Zulip Luke Boswell (Jan 09 2026 at 09:51):

If you create a snapshot, and then run that you should be able to reproduce the bug.

view this post on Zulip Luke Boswell (Jan 09 2026 at 09:52):

I think zig build snapshot -- path/to/snapshot.md is how you run one individually

view this post on Zulip Luke Boswell (Jan 09 2026 at 09:53):

The snapshots are located here https://github.com/roc-lang/roc/tree/main/test/snapshots to see the format you can use (there's a few different types)

view this post on Zulip Luke Boswell (Jan 09 2026 at 09:54):

If you can repro and make a GH issue that would be super helpful, even if you aren't sure about a fix and PR

view this post on Zulip Jared Ramirez (Jan 09 2026 at 22:18):

fwiw, i put this code as a test case in the type checking suite and it infers correctly. maybe this is an issue with how the playground is hooked up?

view this post on Zulip Anton (Jan 12 2026 at 12:35):

I'll take a look

view this post on Zulip Anton (Jan 12 2026 at 13:49):

Fixed in PR#9003


Last updated: Jun 16 2026 at 16:19 UTC