I created a draft PR to migrate all the code examples to the new compiler. I started by migrating all the code examples that can run on the echo platform, without any library dependency. That's 19 examples so far:
AllSyntax (just copied the all-syntax example)BasicDictCommandLineArgs (there's a bug if you run roc build, see issue #10492)CustomInspectErrorHandlingBasicFizzBuzzGraphTraversalHelloWorldImportFromDirectory (will probably require changes soon, see @Luke Boswell 's proposal)IngestFilesJsonLeastSquaresMultiLineComments (no change was required)MultipleRocFilesPatternMatchingSafeMath (note: Dec.times_try is missing)TowersOfHanoiTryOperatorDesugaringTuplesThe only echo-platform-only example remaining is EncodeDecode, but I'm not sure how to handle this one.
If anyone wants to help migrate the rest, please let me know!
Below are the remaining examples to migrate.
The following depend on basic-cli (e.g., cli.File or cli.Cmd), and sometimes on other libraries as well (e.g., rand, unicode, ...):
ImportPackageFromModule => basic-cli + unicode libCommandLineArgsFile => basic-cli (File)Commands => basic-cli (Cmd)ErrorHandlingRealWorld => basic-cli (Env, Http, Dir, Utc, Path)LoopEffect => basic-cli (Stdin)Parser => basic-cli + parserRandomNumbers => basic-cli + randSnake => basic-cli (Tty)SortStrings => basic-cli + asciiThe following are integrations. I have no idea how to do this:
DotNetPlatform => integrate with DotNetGoPlatform => Integrate with GoThe following depend on the web platform:
ElmWebAppHelloWebOthers:
Scripting => points to several external scripts. Not sure whether there's a plan to migrate them.RecordBuilder => uses the <- syntax which doesn't exist anymore. What should we do?EncodeDecode => should work on the echo platform, but I'm not sure how to do this.I migrated 7 more examples. 26 down, 9 to go!
The following remaining examples are tricky:
RandomNumbers: requires migrating the roc-random library. It looks like it's almost done, right?SortStrings: requires migrating the roc-ascii library. Or perhaps using the unicode library instead?DotNetPlatform => somehow integrate with DotNet. How?GoPlatform => somehow integrate with Go. How?Scripting => points to several external scripts. Have they been migrated somewhere?The following shouldn't be too hard:
RecordBuilder => use the new builder syntaxElmWebApp => use the basic-web platformHelloWeb => use the basic-web platformEncodeDecode => should be straightforward.This is the one you want now https://github.com/kili-ilo/roc-random -- it's been getting a lot of love recently from @Austin Clements
I'd drop DotNet and Go for now (or deprecate them until we have support for those). In theory I could probably figure it out but I'm already spread so thin I'm not about to start that.
I'd drop Scripting too for now
@Hannes would you mind porting roc-ascii?
Migrated the RandomNumbers example. The rand library works like a charm! :grinning:
I have a version of roc-ascii updated to the new compiler locally, just haven't got round to cleaning it up and pushing it yet, i'll see if I can get something out this week :)
Legendary
I'm hitting a few issues for the 5 remaining examples:
EncodeDecode: I'm running into a segfault, see issue #10584RecordBuilder: I haven't been able to get even a super minimal example of the new { ... }.Foo + map2 syntax working. I'm too too dumb for record builders! :sweat_smile:SortStrings: needs the roc-ascii library, @Hannes is on it :+1:HelloWeb: there seems to be something wrong with basic-webserver, see issue #10586ElmWebApp: same. Btw, wouldn't it be a good idea to have a Wasm example as well, so both the frontend and backend are written in Roc?Edit: I finally understood record builders. I've posted a minimal example if anyone else is struggling.
wouldn't it be a good idea to have a Wasm example as well, so both the frontend and backend are written in Roc?
Should we just use joy here?
Just 3 examples to go: SortStrings, HelloWeb, and ElmWebApp. Perhaps we can put the rest of the examples online already, and add these three when they're ready?
Yes, I will try to review https://github.com/roc-lang/examples/pull/258 today
@Aurélien Geron Let me know if I can help out with Joy, and I'd love to hear what you think of it and any issues you may run into! I'm chronically Roc'y, so just @ me :)
Thanks @Niclas Ahden, I'm busy today and tomorrow, but I should have some time this weekend. :+1:
@Niclas Ahden FYI I'm waiting for basic-webserver before I can update the web examples.
What do you need for basic-webserver?
I'm blocked by issue #211
I'll try and get something out today
Btw, now that we have many updated examples, perhaps the website could be updated to show them rather than point to the all-syntax code on GitHub?
Yeah I'm also working on that, and the web REPL too
@Aurélien Geron https://github.com/roc-lang/basic-webserver/releases/tag/0.16.0
It works! Here's PR #260 to update the HelloWeb and ElmWebApp examples.
I'll try to add a Joy example too.
Last updated: Aug 12 2026 at 12:35 UTC