The Snobol Implementation Language (SIL)

Page created: 2025-05-06
Drawing of a little rat on a snowball with a heart drawn by Dave Gauer in Krita

Back to I learned Snobol and then wrote a Forth.

SNOBOL4 is a cool language from the 1960s.

SNOBOL4 is also special because it was implemented in what we would now describe as instructions for a "virtual machine". That was very unique for the time when almost all programming languages were implemented in assembly language on their target computers.

The language is called SIL ("SNOBOL4 Implementation Language) and Ralph Griswold’s insight was that SIL operations could be defined as macros in assemblers:

"…​most machines have assembly languages with macro facilities that permit the definition of new operations. Taking advantage of existing macro assemblers, therefore, makes the implementation of SIL considerably easier."

It was still a challenge:

"These operations must be machine-independent over a wide range of machine architectures. SNOBOL4 has to be written in SIL in such a way that it can be assembled by a variety of assemblers without major revisions."

So the idea is that if you implement the SIL macros in your favorite assembler, you can feed the SIL source of SNOBOL4 into the assembler, and out will pop the SNOBOL4 executable.

A picture of the front cover of the book

Griswold wrote about this in a book titled The Macro Implementation of SNOBOL4 published by W. H. Freeman and Company in 1972. The above quotes are from Chapter 10.

Very cool idea, right?

Oh, but it gets cooler than that, my friend. If you grab a copy of Phil Budne’s csnobol4 (specifically snobol4-2.x.x.tar.gz) and start looking around, you realize that it’s running an original SNOBOL4 "macro implementation"!

E32 (DECEMBER 18, 1969) V3.7

So that’s pretty mind-blowing right there. How many programs from the 1960s do you typically see running from the original source?

Sure, the BSDs can trace a lineage back pretty far, but I’m pretty sure those have been Ship of Theseus'd (wikipedia.org) many times over since inception.

I also really enjoy SIL because it’s a reminder that while it’s easy to take the "standard" methods of implementation of compiled and interpreted languages more-or-less for granted in a "this is how it’s done" sort of way, these methods were not handed down to us carved on wafers by the Computing Gods from Silicon Mountain. They were invented by very clever people, one at a time, over years.