Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Snobol Pattern Matching [closed]

My question is simple. Is the programming language Snobol4 still useful to provide a modern day solution for pattern matching, or has regex in other procedural languages pretty much wiped it out in application?

like image 245
duskamo Avatar asked Nov 25 '14 17:11

duskamo


1 Answers

The pattern language is modeled on context free grammars, with context sensitive extensions that provide full (type 0) computational capabilities.

This is from an introduction originally written by Robert Dewar, creator of the SPITBOL implementation of SNOBOL-4. Since both references are in relatively new, and maintained libraries, I'd think that even though the pattern language is not part of, say, JavaSrcipt with its statistically many uses, or part of other modern languages, it might surprise users of REs in terms of speed and power.

That being said, SNOBOL-4 patterns have been criticized for leading to hard to understand programs, for using FENCE, not NOT (Farber? Gimpel?) and other phenomena that seem to have a come-back with Perl5 compatible "regular expressions", and ICU's. They, too, are rediscovering some effects of backtracking and anchors. R.E. Griswold, creator of SNOBOL-4, has later created the Icon programming language. It features generators and goal directed evaluation, thus taking backtracking to a level at which arguably search is more clearly expressed than one could do using the implications of complex patterns.

Insofar as this historic development is preceding today's "REs" growing in power, I'd say that SNOBOL-4 patterns offer something to the profession for evaluation, what to do again and what not to do again.

Say, do we need a BAL pattern in practice?

like image 181
B98 Avatar answered Nov 13 '22 05:11

B98