Thoughts on Chez Scheme / 2026 Jul 09 ------------------------------------- Thanks to SDF, I've become a bit of a NetBSD enthusiast. I run my blog off a SDF NetBSD VPS. I'll probably describe that setup in more detail in another post. In short, I fell in love with how minimal NetBSD is - if I'm not logged in running top, there are just 16 processes running. dehydrated, bozotic httpd, haproxy were the only three bits I needed to get my website going. openrsync to publish. It took some time, but nothing felt arbitrary or incidental. But, wait ... what does this have do with Chez Scheme??? I've been re-learning a bit of C and occasionaly trying things from the Advanced Programming in the UNIX Environment on NetBSD. Good stuff, but sometimes I want something a bit more interactive. For the day job, I use Clojure, so I'm very much used to playing around with an API at a REPL, poking and prodding like a kid. About a month ago I remembered Chez Scheme. I'd used Petite Chez more than a decade ago when I was trying to understand miniKanren and its many variants (cKanren, alphakKanren, etc.). I knew that Racket had replaced hundreds of thousands of lines of C with Chez. What is Chez? Chez Scheme is a 40-year old optimizing Scheme compiler from Kent Dybvig. Chez is self-contained. No LLVM stuff, all the compiler (nano) passes are written in Scheme itself. While there is an interpreter, Chez generally just immediately compiles forms to native code. Chez has a pretty civilized FFI. If I want to, say, learn something about X11, I setup the bindings and then interactively create UI elements on the fly. For example a binding looks like this: (define draw-lines (foreign-procedure "XDrawLines" (void* unsigned-long void* void* int int) int)) You can sort out the signature from the shell with: $ man XDrawLines Using a binding looks something like this: (define (repaint) (x:clear-window x-display x-window) (x:draw-lines x-display x-window x-gc x-points 4 0) (x:draw-string x-display x-window x-gc 100 50 window-text (string-length window-text)) (x:flush x-display)) Geiser for Emacs makes the whole experience extremely pleasant. You can live code a UI directly from your text editor. Old hat for the Smalltalkers and Commmon Lispers, but really great to see that I have a ceremony-free way to really play around with NetBSD / X11. The fact that R6RS is frozen in stone is IMHO a huge feature in a software world that embraces churn. Outside of maybe Lua, the principles of minimal specification, maximal power has largely been looked over in favor of feature creep, cleverness, and complexity.