Stream: show and tell

Topic: roc-syntax-color


view this post on Zulip Steve Howell (Nov 20 2026 at 13:11):

I wrote a package that syntax-colors Roc code (Str -> List(Span)).

See https://github.com/showell/roc-syntax-color/blob/main/README.md

As with all my code, this is agent written under my supervision. Claude didn't take a ton of supervision to write a color syntax library, but I did ask for it to be fairly minimal (my taste). It's UPL and free to modify.

I use it in production for my little Roc book (see #contributing > a little Roc book). It's coming to my chat (see #show and tell > roc-chat) on the next deployment.

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

For a taste of the code see https://github.com/showell/roc-syntax-color/blob/main/package/RocSyntax.roc

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

It supports roc, zig, JS, and shale, and I'm taking requests for other languages.

view this post on Zulip Steve Howell (Nov 20 2026 at 13:48):

Roc makes for pretty readable parsing code. Here's a little snippet:

## What a `{` opens, from the token before it.
brace_frame : Before -> Frame
brace_frame = |before| match before {
    Dot => TypeBlock
    Value | Equals | FatArrow | BarClose | Keyword => Body
    Start | Colon | Arrow | BarOpen | Opener | Operator => Record
}

Note that Zulip lacks color syntax for Roc. :cry:

view this post on Zulip Steve Howell (Nov 20 2026 at 16:25):

See it in action here (roc, js, shale, zig): https://roc.lynrummy.com/syntax-color/

view this post on Zulip Steve Howell (Nov 20 2026 at 16:49):

C is now there as well.

view this post on Zulip Steve Howell (Nov 20 2026 at 23:32):

See also https://roc.lynrummy.com/welcome-to-roc/

It requires a normal sized laptop/desktop monitor. It shows Roc color syntax for a real program.

view this post on Zulip Steve Howell (Nov 21 2026 at 02:30):

I also added Odin and Python. I think language nerds will appreciate the code samples that I curated for those two languages. See the bottom of the roc-syntax-color example page.


Last updated: Nov 26 2026 at 20:35 UTC