3 ms·
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 m
by hello_computer 3y ago
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 3y agoOh wow, that's super impressive. Is there anything that comes to close this functionality today, outside of SNOBOL?
- skulk 3y agohttps://en.wikipedia.org/wiki/Parsing_expression_grammar https://en.wikipedia.org/wiki/Parsing_expression_grammar
- jbottoms 3y agoThere 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.