SNOBOL (“StriNg Oriented and SymBOlic Language”)
en.wikipedia.org
en.wikipedia.org
A SNOBOL pattern can be very simple or extremely complex. A simple pattern is just a text string (e.g. "ABCD"), but a complex pattern may be a large structure describing, for example, the complete grammar of a computer language. It is possible to implement a language interpreter in SNOBOL almost directly from a Backus–Naur form expression of it, with few changes. Creating a macro assembler and an interpreter for a completely theoretical piece of hardware could take as little as a few hundred lines, with a new instruction being added with a single line.
...
Patterns can be saved like any other first-class data item, and can be concatenated, used within other patterns, and used to create very complex and sophisticated pattern expressions. It is possible to write, for example, a SNOBOL4 pattern which matches "a complete name and international postal mailing address", which is well beyond anything that is practical to even attempt using regular expressions.
Not sure if this means snail mail, but I don't know why I never considered that before email, people used physical mail for things like tech support, heck, maybe submitting patches
We also covered Scheme, Prolog, and . . . Java. :-) Okay this was the 90s when OO was new, but still maybe they should have gone with something like Smalltalk.
I once was paid real money to develop in VA Smalltalk. It was a fun language. Dave Ungar and Dan Ingalls said a few things that made me think they planned at one point to add spitbol-esque features to Smalltalk. And Alan Kay once quipped something about wishing he had seen scheme before writing smalltalk grammar.
For better or worse, bits of Smalltalk live on in Java and Ruby and bits of Scheme can be found in JavaScript if you look hard enough. Where did Icon and Spit/Sno-bol wind up? Alas.
And .NET/C#, as Java nemesis :)
https://github.com/gcc-mirror/gcc/blob/master/gcc/ada/libgna...
-- SPITBOL-like interface facilities
-- This package provides a set of interfaces to semantic operations copied
-- from SPITBOL, including a complete implementation of SPITBOL pattern
-- matching. The code is derived from the original SPITBOL MINIMAL sources,
-- created by Robert Dewar. The translation is not exact, but the
-- algorithmic approaches are similar.Was SIL the inspiration for ZIL (Zork Implementation Language) which was also a virtual machine and allowed Infocom to release their text adventures on so many home computer platforms at once in the 80s?
My all-time favorite was GPSS (General Purpose Simulation System) which would simulate transactions in a model...think of cars arriving from four directions at a traffic light. You could tweak the car arrival times and the length of red/green lights and get different outputs for 'wait time'.
I loved it so much, I asked my professor if there were good opportunities for a career using GPSS. He answered 'no' (LOL) and so I never pursued it.
Over the next two days I did a Mini-Course for a few engineers about why you may not want to use RegExes for everything. Spitbol played a leading role and those engineers walked away enlightened.
They were, of course, fired because they started asking other engineers in the company to modify their outputs so they could be parsed reliably with regexes. But that's okay, they went on to successful careers at other companies who provided decent health care options.
So... at least for a small number of engineers in Seattle, SNOBOL resulted in them getting decent health insurance.
I call that a win.
Also... I know half the people reading this will say something like "of course you can parse HTML with RegExes! I do it all the time!" -- I suggest you're parsing a subset of (x)(ht)(ml) and your code can easily get flummoxed with valid HTML, just not in the format you were used to. If you can recover from regex failures or modify the input to the regex so you don't get failures, more power to you! I'm not gonna argue with someone producing working code. The person who maintains your code after you leave may curse your name, however. But by that time your uber stock will be worth something and you'll be driving your bitcoin lambo to the beach every day so what do you care?
Anyway, SO had A LOT of discussion about RegExes and HTML:
https://stackoverflow.com/questions/6751105/why-its-not-poss...
"Alas, poor SNOBOL! I knew him, HN: a language of infinite jest, of most excellent fancy: he hath borne me over the pains of regular languages a thousand times; and now, how abhorred in industry it is!"
https://csh.rit.edu/~jerry/arcade/tron/index.html
Back in the early 90's, I used REXX a lot for string processing and shell-type tasks, it was a great language.
Decades later and Python is my language of choice.
(It's also somehow strange to see the author photos accompanying that article, I guess since for one, unlike many other -lang-article-photos, these seem fairly up-to-date, turning the popular-language-with-old-photos wiki-norm on its head)
SNOBOL was a one-of-a-kind pattern matching language at the time. Now there are lots of them, or rather, lots of regular expression features.
It had nothing whatever to do with COBOL.
Except for the name, which IIRC was an intentional dig at an early COBOL standard that defined how you pronounced 'COBOL'. 'SNOBOL' can sound like 'snow-ball', analogous to a US accent where COBOL can be pronounced 'CO-ball'.
[Edit] I used SNOBOL briefly in the 80s at Uni. It was one of the first 'odd' languages we were introduced to after Pascal, along with APL.
By "US accent" do you mean that "COBOL" would be pronounced "snowball" in the UK? That's really news to me.
I thought I knew almost all the differences between US & UK English, but this would be a new one on me, if true.
... in the 1980s ...
Of course nobody actually knew or used it.
I learned and used SNOBOL for RBK Dewar's compiler classes at NYU, 78-79. (Dewar was one of the authors of SPITBOL, an implementation of the language).
Because of this, experience, a couple of years later, in grad school elsewhere, I was able to help someone in the computing center debug a client's SNOBOL program.
Sure, this wasn't a huge insurance company writing their payroll system, but SNOBOL was a real language. But ignoring that: SNOBOL was a completely unique language, beautiful in its own way. It looked like a very sparse form of assembler language. Control flow was bizarre: a statement could "succeed" or "fail", and a statement could specify goto targets for either, both, or none of these cases. (I don't know the exact dates, but SNOBOL must have been designed around the same time as the famous "Goto considered harmful" letter.)
As a measure of how good the language was: SNOBOL is famously based on the idea of string pattern matching. I found SNOBOL completely intuitive and easy to use. By contrast, I find UNIX regular expressions incomprehensible, and they send me to RTFM each time I use them. I have a similar view of Perl. Ugly and unintuitive, the exact opposite of SNOBOL.
Also, I would like to recommend the Griswold, Poage, and Polonski book on SNOBOL4. I remember it as a truly excellent language book, on the level of K&R.
I took one of his classes as an undergraduate at NYU, but used SNOBOL, SETL, and some other early languages as part of a young scholars high school program at NYU in the early 80s.
Also, that experience primed me for appreciating the relational model, and relational algebra, and I went on to specialize in DBMSs.
- Towers of Hanoi in SNOBOL
- It's true: Ada on CP/M
- Discover your inner extrovert with Smalltalk-80
- In the '90s everything will be in Eiffel
- How to ace your next Modula-2 interview"4.6.4 Example - Tower of Hanoi" on pages 109-111 (the scanned page numbers)
Here's the program in its all-caps, weirdly indented beauty:
DEFINE('HANOI(N,NS,ND,NI)') :(HANOI.END)
HANOI EQ(N,O) :S(RETURN)
HANOI(N - 1,NS,NI,ND)
OUTPUT 'MOVE DISC ' N ' FROM ' NS ' TO ' ND
HANOI(N - 1,NI,ND,NS) :(RETURN)
HANOI.END
TEST HANOI (5,'A','C','B')
ENDIn the 1960s, most programming was done on punched cards, and keypunch machines (and many computers) didn't have lower case letters on them. Hence, languages from that era, like FORTRAN, COBOL, PL/I, LISP and assembly language, were written in all-caps.
(The book's title is misleading now: it doesn't much overlap a modern undergrad intro to algorithms. It's more "here are examples and techniques of programming in SNOBOL".)
(Maurer also composes or composed music. His madrigal "Forty Bucks" set to music the text of a Montgomery County, Maryland, photo enforcement ticket.)
We quite possibly crossed paths at GWU back then.