[HN Gopher] SNOBOL ("StriNg Oriented and SymBOlic Language")
___________________________________________________________________
SNOBOL ("StriNg Oriented and SymBOlic Language")
Author : hello_computer
Score : 71 points
Date : 2023-05-03 11:19 UTC (11 hours ago)
(HTM) web link (en.wikipedia.org)
(TXT) w3m dump (en.wikipedia.org)
| laurasia99 wrote:
| The paper "Implementing SNOBOL4 in SIL; version 3.11" by Griswold
| is interesting to look at
| (<www.regressive.org/snobol4/doc/arizona/s4d58.pdf>). It looks
| like there is some code at github
| (https://github.com/mdhender/sil/blob/main/v311.sil) but I
| haven't looked at the provenance of it.
| KWxIUElW8Xt0tD9 wrote:
| my recollection of SNOBOL from college is that it has awesome
| pattern matching capabilities, much better than the usual regex
| stuff
| bachmeier wrote:
| This brings back memories of the way they used to teach
| programming. I had to learn some SNOBOL for a class, but to this
| day I've never written a line of it. We didn't even have access
| to such machines. Lectures were done on a chalkboard. The few
| programming assignments (in Pascal?) were done on our own in a
| lab elsewhere on campus. We'd print out the program and output
| and it'd be graded by hand.
| noisy_boy wrote:
| I learned Fortran this way - learned from the book and just
| wrote pages of programs by hand, never running them because, no
| computer. Appeared in exam and did the same thing, got graded
| and done. Still no computer.
| scarygliders wrote:
| A very long time ago, and for reasoning totally lost in my then
| young mind, I bought a book on SNOBOL, and promptly got bored
| trying to read it.
|
| Decades later and Python is my language of choice.
| AtlasBarfed wrote:
| I remember this as one of the computer languages you would list
| to make it seem like you knew a lot about computer languages.
|
| ... in the 1980s ...
|
| Of course nobody actually knew or used it.
| geophile wrote:
| This is just completely wrong.
|
| 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.
| codeulike wrote:
| Seems like you know a lot about computer languages
| geophile wrote:
| I assume that you are attempting sarcasm here, but I'm
| missing your point.
| 1n3nt0r wrote:
| Nice to hear mention of RBK Dewar. He was well known in the
| programming languages field as a professor at NYU, but also
| was quite successful as an entrepreneur with his various
| compilers (I think his company was called "Realia").
|
| 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.
| geophile wrote:
| I remember SETL, and it made a huge impression on me --
| just the idea of sets as a primitive datatype. I remember
| one lecture on using SETL to specify language
| optimizations, which were set-oriented.
|
| Also, that experience primed me for appreciating the
| relational model, and relational algebra, and I went on to
| specialize in DBMSs.
| pavlov wrote:
| Imagining some 1980s Hacker News clickbait #1 headlines:
| - 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
| marcodiego wrote:
| I think "Towers of Hanoi in SNOBOL" would get to first page
| even today.
| tpmx wrote:
| https://raganwald.com/assets/snobol-green-book.pdf
|
| "4.6.4 Example - Tower of Hanoi" on pages 109-111 (the
| scanned page numbers)
| pavlov wrote:
| Is it even a 1980s programming language without a Hanoi
| example?
|
| 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') END
| greenyoda wrote:
| Actually, SNOBOL is a _1960s_ programming language[1], so
| it wouldn 't have been a trendy new language in an 80s
| version of HN.
|
| In 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.
|
| [1] https://en.wikipedia.org/wiki/SNOBOL
| abecedarius wrote:
| Heh. I got into computing in the 80s, and your other
| headlines are much more plausible. I did find a very
| interesting library book _Algorithms in SNOBOL4_ by Gimpel,
| so I actually got familiar with it -- but that was sheer
| luck.
|
| (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".)
| RHSeeger wrote:
| I learned SNOBOL in college, back in the early 90s. Admittedly,
| it was a course about computer languages in general, not SNOBOL
| in particular.
| cafard wrote:
| I took a class on programming languages from Douglas Maurer,
| who had written a book on SNOBOL. It was out of print, which
| saved a few dollars for the students, since he provided
| photocopies. SNOBOL did not look especially practical, but the
| built-in pattern matching made Awk and Perl that much easier to
| learn.
|
| (Maurer also composes or composed music. His madrigal "Forty
| Bucks" set to music the text of a Montgomery County, Maryland,
| photo enforcement ticket.)
| RHSeeger wrote:
| SNOBOL was the first language I learned with pattern
| matching. It was, at least to my memory, pretty much the main
| interesting feature of the language.
| rootbear wrote:
| Thank you! I took a programming languages survey course when
| getting my Masters at GWU in the early 90s. It was taught by
| Dr. Maurer. I couldn't remember his name, but I did remember
| that he was into SNOBOL. I really need to find his "Forty
| Bucks" madrigal.
| cafard wrote:
| It was performed by an amateur theatre group called "The
| Hexagon Club", at a show maybe a dozen years ago. I've
| searched on-line without luck--it probably doesn't help
| that Tom T. Hall wrote a song called "The Ballad of Forty
| Dollars". Anyway, good luck.
|
| We quite possibly crossed paths at GWU back then.
| mountainofdeath wrote:
| True. I had a professor mention SNOBOL a few times in lectures.
| The same professor only taught classes in Scheme, including CS
| 101 and Software Engineering. The man was stuck in the 80s in
| every way.
| [deleted]
| retrocryptid wrote:
| I love Snobol (and its descendent spitbol.) While an engineer at
| a large, unnamed company named after a river in South America, I
| was somewhat amazed by how "No computing problem was untouched by
| regular expressions" including scanning html. After many
| hilarious inter-team failures, we finally got approval to speak
| with our peers. I pointed out that HTML can't "really" be parsed
| with regexes (yes, I know, there are subsets of HTML that regexes
| work perfectly well with, but in this instance we did not control
| the input). Thus got a lot of blank looks. Then I mentioned
| "context free" versus "regular" and more blank looks. Someone in
| the back made a quip about not expecting a CS101 lecture at work.
|
| 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!"
| gowld wrote:
| I always conflate SNOBOL with INTERCAL
|
| https://en.m.wikipedia.org/wiki/INTERCAL
| themodelplumber wrote:
| I can see why. One is a whimsically-named, serious language.
| The other is a seriously-named, whimsical language (from what I
| can tell).
|
| (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)
| rootbear wrote:
| When I was a sysadmin at the Naval Research Laboratory in the
| 80s, I was asked to install Icon, Ralph Griswold's follow-on
| language to SNOBOL. I had a little trouble installing it on our
| Gould minicomputer and mailed in a support request. It was
| answered by Griswold himself! I felt special! (It was just a
| Makefile issue, as I recall. This was the era of tar source file
| distribution. No rpms, no snaps, no debs.)
| pjungwir wrote:
| Oh wow, I learned a little Icon in college as part of a class
| on different programming paradigms. As soon as I saw the thread
| title I thought, "That sounds a lot like Icon."
|
| 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.
| retrocryptid wrote:
| Oh man. Smalltalk has a huge learning curve. Of course, once
| you master a few dozen concepts you can just crank out the
| applications.
|
| 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.
| pcthrowaway wrote:
| > I had a little trouble installing it on our Gould
| minicomputer and mailed in a support request
|
| 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
| lagniappe wrote:
| Sometimes you'd see a program you wanted in the back pages of
| pcworld or another one of those huge computer-warehouse type
| magazines, and you'd have to fill out a little card and mail
| in a check while trusting that in a month or two it'd
| arrive.. I got wolf3d, jill of the jungle, and commander keen
| this way.
| mysterydip wrote:
| I recently found a package from some PCAnywhere-esque
| software company that mailed me a copy back in the late
| 90s.
| rootbear wrote:
| I meant email, which is generally my default meaning for
| "mail". I could have worded it better...
| guerby wrote:
| Lives in GNAT, GCC Ada:
|
| 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.
| defaultcompany wrote:
| _The SNOBOL4 language translator was still written in assembly
| language. However the macro features of the assembler were used
| to define the virtual machine instructions of the SNOBOL
| Implementation Language, the SIL_
|
| 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?
| SBArbeit wrote:
| I never wrote any SNOBOL, but definitely remember it from Tron.
|
| 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.
| dangling42 wrote:
| Oh, they found COBOLs lost brother ;)
| geophile wrote:
| They could not be less similar.
| timbit42 wrote:
| Don't forget SCOBOL - Screen COBOL for the Tandem NonStop
| systems.
| 082349872349872 wrote:
| Tandem cheaped out on the company coffee mugs: they only had
| two handles, not three.
| AlbertCory wrote:
| Display your ignorance anytime. We're here for you.
|
| 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.
| KineticLensman wrote:
| > 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.
| AlbertCory wrote:
| Americans wouldn't say "Uni" so I assume you're from the
| UK.
|
| By "US accent" do you mean that "COBOL" would be pronounced
| "snowball" in the UK? That's really news to me.
| omoikane wrote:
| I think COBOL is still in use today in some form[1], are there
| modern systems that depend on SNOBOL?
|
| [1] https://en.wikipedia.org/wiki/ABAP
| anthk wrote:
| Today you have Unicon.
| joelrwilliams1 wrote:
| While studying Computer Science as an undergrad, I took a SNOBOL
| course (or maybe it one of the languages taught in a general
| coding course) ...either way, it was glorious. I love languages
| that are 'task-oriented'.
|
| 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.
|
| https://en.wikipedia.org/wiki/GPSS
| hello_computer wrote:
| Of particular interest:
|
| _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._
| rashkov wrote:
| Oh wow, that's super impressive. Is there anything that comes
| to close this functionality today, outside of SNOBOL?
| jbottoms wrote:
| There were, and I kid you not, two simular languages;
| "SLUSHBOL" and "SPITBOL". But they are lost for the ages.
| Edit: I see that SPITBOL has been observed. No word on
| SLUSHBOL.
| skulk wrote:
| https://en.wikipedia.org/wiki/Parsing_expression_grammar
| WesBrownSQL wrote:
| https://en.wikipedia.org/wiki/SPITBOL FTW! I got turned onto
| SPITBOL in the early '00's from a colleague who used it as a
| rapid utility language for writing small command line apps.
___________________________________________________________________
(page generated 2023-05-03 23:01 UTC)