Stream: show and tell

Topic: BASIC (1964), in Roc (2026)


view this post on Zulip Steve Howell (Sep 13 2026 at 14:16):

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. :)

view this post on Zulip Steve Howell (Sep 13 2026 at 14:21):

repo: https://github.com/showell/roc-apps/blob/master/basic/roc

view this post on Zulip Steve Howell (Sep 15 2026 at 17:02):

The BASIC repl now lives here: https://roc.lynrummy.com/basic/basic.html

This was in interesting challenge in Roc! (even with agent help)

view this post on Zulip Steve Howell (Sep 15 2026 at 21:49):

image.png

view this post on Zulip Steve Howell (Sep 15 2026 at 21:49):

see also: #beginners > Roc tour

view this post on Zulip Aurélien Geron (Sep 16 2026 at 03:27):

Awesome! This brings me back to 1983, when I first started coding in Basic on a TI-99/4a! :smile:

view this post on Zulip Steve Howell (Sep 16 2026 at 12:11):

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.

view this post on Zulip Aurélien Geron (Sep 16 2026 at 19:54):

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:

view this post on Zulip Steve Howell (Sep 20 2026 at 02:08):

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.

view this post on Zulip Steve Howell (Sep 20 2026 at 02:10):

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.

view this post on Zulip Richard Feldman (Sep 20 2026 at 12:51):

good to know! I'm interested to explore ways to make it easier to diagnose undesirable cloning in the future

view this post on Zulip Steve Howell (Sep 20 2026 at 13:14):

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. :)

view this post on Zulip Anton (Sep 21 2026 at 11:52):

Thanks for the feedback @Steve Howell!


Last updated: Sep 24 2026 at 15:59 UTC