mike parr's pages

Home

Snobol - Mike Parr

Snobol - Getting Started on Windows in 2024

We are going vintage again here. Snobol is a very interesting programming language, its forte being string pattern-matching. It was created around 60 years ago in fact, and the first publication was in 1964: Snobol - a String Manipulation Language. Recall that C came out is the early 70s. Actually, I wanted to use Snobol in in the 70's, but could not get a version that ran on the computers I had access to. Around 50 years later, I thought that I would try again.

Some Resources

The Wikipedia page presents a history .

Snobol4 Resources - a mass of info, links related to Snobol4 - this seems to be regarded as the closest version to the 'green book' - see below.

The Snobol5 site - by Viktors Berstis - provides lots of general info to guides, user groups, and a download for the Windows version of Snobol5.

The classic text by its creator ('The Snobol4 Programming Language' by Griswold etc - the 'green book') is out of print, but you might find an old copy on Amazon, etc. (I got a copy from Amazon for £12, including postage from USA to UK, and it is an excellent read.) The Snobol5 site has a downloadable pdf, as does the '4' site here: Green Book

Here is a brief guide to the language. Note that if you paste its code, the left and right-leaning single quotes should be replaced with the normal single-quote ' character.

Snobol on Windows

Snobol was created decades before Windows and Dos, and the command-line approach is common. Here, I'm trying to persuade Windows users to give it a go.

First, you need to download a Snobol compiler, and then you need to choose/download an editor. Below I provide a modern Windows editor -Snobed - which is intended to simplify things for the beginner, In fact, you could use any text editor, but a minor advantage of Snobed is that you don't have to play around with setting the Windows PATH variable for your compiler. Note that the Snobol5 site also has some high-quality tools (written in Snobol5), such as a powerful keyboard-oriented editor, a cross-referencer, and a pretty printer.

Setup: you can store your downloads anywhere. Here is one possible folder structure:

    SnobolStuff
        SnobolSystems
        SnobolCode
Store your downloaded compiler folders in SnobolSystems, and write your programs in SnobolCode.

To download the '4' compiler, use this Index of Snobol4 page. Download the latest one, which has a name similar to win10-64-2.3.2.tar.gz

You might be unfamiliar with the tar.gz type. It is an archived structure, zipped-up. Your zip package might take one go to unzip, producing a single 'tar file, then another go at the tar to unzip all the files, including snobol4.exe, found in the its bin folder. Put all the unzipped folders in SnobolSystems.

Similarly, download Snobed, and unzip it into SnobolSystems.

The Snobed Editor - Download

I've modified an existing editor that I had (written in Lazarus Pascal, for Windows) to work with Snobol. It has a few Snobol-specific tools, but of lower quality than the Snobol5 ones. It is open-source. Here is a screen-shot:

Here is the Windows binary - Go for this, but if you really want to compile it yourself (and I hope you don't), read the next paragraph.

( here is the source code - it is a Lazarus project, written in Pascal. You need the Lazarus Pascal IDE, from here. Unzip the project folder, run Lazarus. Choose 'Open Project', and browse to the project file, which is "\snobedSource\artide.lpi". Compile and run it by clicking the green arrow at the top. You can now close snobed and Lazarus. The only files that you need from the project folder are artide.exe (rename this to snobed.exe) and the files snobedfragments.txt and snobedhelp.txt. Move these 3 to any folder, and begin).

To use the editor, run snobel.exe. Initially, it asks you to browse to the compiler - e.g. snobol4.exe in bin - then follow the instructions. You can creatw a 'hello-world' program by clicking 'New Program'. Also have a look at the help file. Note that it is simple to have several compilers installed. Just use the snobed menus to point to another snobol .exe.