Claude and I wrote a BASIC repl in Roc web assembly:
http://143.244.172.148:9203/basic/basic.html
The interpreter is pure Roc with a thin JS layer for the REPL.
More details here: http://143.244.172.148:9100/notes/roc-basic-interpreter.md
The IP address is just my Digital Ocean droplet. At some point I'll get a proper domain name. :)
repo: https://github.com/showell/roc-apps/blob/master/basic/roc
The BASIC repl now lives here: https://roc.lynrummy.com/basic/basic.html
This was in interesting challenge in Roc! (even with agent help)
![]()
see also: #beginners > Roc tour
Awesome! This brings me back to 1983, when I first started coding in Basic on a TI-99/4a! :smile:
Aurélien Geron said:
Awesome! This brings me back to 1983, when I first started coding in Basic on a TI-99/4a! :smile:
That was my first computer as well! Either 1982 or 1983. They had a PacMan clone called MunchMan. After I read their excellent tutorial, one of the first programs I wrote was a really bad version of MunchMan.
Haha, so cool, I used to love that game! You can play it now on the emulator I linked to (choose Software > More... > Search for MunchMan). :grinning_face_with_smiling_eyes:
In our meetup today, Richard asked for "experience reports" and encouraged us to be candid. I have some really positive things to say about Roc tomorrow, but I am trying to polish up some of my own work for that first.
Now for the negative. I can candidly say that Roc is not great for writing interpreters, even for a simple language like BASIC. You end up jumping through hoops to get performance. With any kind of performance demands, you end up worried about when Roc is going to make full copies of objects under the hood. You learn for truly performant immutable data structures like Elm has. But even then, it's less than satisfying. For example, I would much rather do the BASIC REPL in TypeScript than in Elm or Roc. Or I'd even prefer zig.
good to know! I'm interested to explore ways to make it easier to diagnose undesirable cloning in the future
Richard Feldman said:
good to know! I'm interested to explore ways to make it easier to diagnose undesirable cloning in the future
I already linked this above, but this describes some of the directions we took:
http://143.244.172.148:9100/notes/roc-basic-interpreter.md
It would be fun to see somebody with more Roc knowledge than I have take on the challenge of making BASIC faster while still idiomatic. The "NBS Minimal BASIC test programs" are a good stress test of the interpreter.
https://github.com/showell/roc-apps/blob/master/basic/roc/Vec.roc is a good example of how Claude and I tried to work around quadratic behavior for statements like "I = I + 1" in BASIC.
I may eventually come back to this, but I am now working on apps that are much more in Roc's wheelhouse but which still pose interesting design questions. More on that to come. :)
Thanks for the feedback @Steve Howell!
Last updated: Sep 24 2026 at 15:59 UTC