GO-Ve01
ServicesDevelopersBooksDictionaryPapersWikidataEncyclopediaSearchBabelCareersDeck

SNOBOL

SNOBOL (StriNg Oriented and symBOlic Language) is a series of programming languages developed between 1962 and 1967 at AT&T Bell Laboratories by David J. Farber, Ralph Griswold and Ivan P. Polonsky, culminating in SNOBOL4. It was one of a number of text-string-oriented languages developed during the 1950s and 1960s; others included COMIT and TRAC. Despite the similar name, it is entirely unlike COBOL. SNOBOL4 stands apart from most programming languages of its era by having patterns as a first-class data type, a data type whose values can be manipulated in all ways permitted to any other data type in the programming language, and by providing operators for pattern concatenation and... Source: e01 Encyclopedia. Licence: CC BY-SA 4.0.

SNOBOL (StriNg Oriented and symBOlic Language) is a series of programming languages developed between 1962 and 1967 at AT&T Bell Laboratories by David J. Farber, Ralph Griswold and Ivan P. Polonsky, culminating in SNOBOL4. It was one of a number of text-string-oriented languages developed during the 1950s and 1960s; others included COMIT and TRAC. Despite the similar name, it is entirely unlike COBOL. SNOBOL4 stands apart from most programming languages of its era by having patterns as a first-class data type, a data type whose values can be manipulated in all ways permitted to any other data type in the programming language, and by providing operators for pattern concatenation and alternation. SNOBOL4 patterns are a type of object and admit various manipulations, much like later object-oriented languages such as JavaScript whose patterns are known as regular expressions. In addition SNOBOL4 strings generated during execution can be treated as programs and either interpreted or compiled and executed (as in the eval function of other languages). SNOBOL4 was quite widely taught in larger U.S. universities in the late 1960s and early 1970s and was widely used in the 1970s and 1980s as a text manipulation language in the humanities. In the 1980s and 1990s, its use faded as newer languages such as AWK and Perl made string manipulation by means of regular expressions fashionable. SNOBOL4 patterns include a way to express BNF grammars, which are equivalent to context-free grammars and more powerful than regular expressions. The "regular expressions" in current versions of AWK and Perl are in fact extensions of regular expressions in the traditional sense, but regular expressions, unlike SNOBOL4 patterns, are not recursive, which gives a distinct computational advantage to SNOBOL4 patterns. (Recursive expressions did appear in Perl 5.10, though, released in December 2007. ) The later SL5 (1977) and Icon (1978) languages were designed by Griswold to combine the backtracking of SNOBOL4 pattern matching with more standard ALGOL-like structuring. label subject pattern = object : transfer Each of the five elements is optional. In general, the subject is matched against the pattern. If the object is present, any matched portion is replaced by the object via rules for replacement. The transfer can be an absolute branch or a conditional branch dependent upon the success or failure of the subject evaluation, the pattern evaluation, the pattern match, the object evaluation or the final assignment. It can also be a transfer to code created and compiled by the program itself during a run. 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. Complex SNOBOL patterns can do things that would be impractical or impossible using the more primitive regular expressions used in most other pattern-matching languages. Some of this power derives from the so-called "SPITBOL extensions" (which have since been incorporated in basically all modern implementations of the original SNOBOL 4 language too), although it is possible to achieve the same power without them. Part of this power comes from the side effects that it is possible to produce during the pattern matching operation, including saving numerous intermediate/tentative matching results and the ability to invoke user-written functions during the pattern match which can perform nearly any desired processing, and then influence the ongoing direction the interrupted pattern match takes, or even to indeed change the pattern itself during the matching operation. 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. SNOBOL4 pattern-matching uses a backtracking algorithm similar to that used in the logic programming language Prolog, which provides pattern-like constructs via DCGs. This algorithm makes it easier to use SNOBOL as a logic programming language than is the case for most languages. SNOBOL stores variables, strings and data structures in a single garbage-collected heap. OUTPUT = "Hello, World!" END A simple program to ask for a user's name and then use it in an output sentence... OUTPUT = "What is your name?" Username = INPUT OUTPUT = "Thank you, " Username END Use :S (branch on successful match) to choose among three possible outputs... OUTPUT = "What is your name?" Username = INPUT Username "J" :S(LOVE) Username "K" :S(HATE) MEH OUTPUT = "Hi, " Username :(END) LOVE OUTPUT = "How nice to meet you, " Username :(END) HATE OUTPUT = "Oh. It's you, " Username END To continue requesting input until no more is forthcoming... OUTPUT = "This program will ask you for personal names" OUTPUT = "until you press return without giving it one" NameCount = 0 :(GETINPUT) AGAIN NameCount = NameCount + 1 OUTPUT = "Name " NameCount ": " PersonalName GETINPUT OUTPUT = "Please give me name " NameCount + 1 PersonalName = INPUT PersonalName LEN(1) :S(AGAIN) OUTPUT = "Finished. " NameCount " names requested." END

References

  1. ^ Ierusalimschy, Roberto; de Figueiredo, Luiz Henrique; Celes, Waldemar (2007), "The evolution of Lua", Proceedings of the third ACM SIGPLAN conference on History of programming languages (PDF) , p. 26, doi : 10.1145/1238844.1238846 , ISBN 9781595937667 , S2CID 475143 Wikipedia revision 1354923960, retrieved 2026-11-18 · 1794956400.0
  2. ^ Wexelblat, Richard L. , ed. (2014) [1981]. History of Programming Languages . Academic Press. p. 784. ISBN 9781483266169 . Wikipedia revision 1354923960, retrieved 2026-11-18 · 1794956400.0
  3. ^ Introduction to the MTS file editor , University of Michigan Computing Center, 1986. Wikipedia revision 1354923960, retrieved 2026-11-18 · 1794956400.0
  4. ^ "SNOBOL4.ORG -- SNOBOL4 Resources" . Wikipedia revision 1354923960, retrieved 2026-11-18 · 1794956400.0
  5. ^ "The MINNESOTA SNOBOL4 Programming Language" . Wikipedia revision 1354923960, retrieved 2026-11-18 · 1794956400.0
  6. ^ "The Snocone Programming Language" , Andrew Koenig, USENIX (Portland, Oregon), June 1985. Retrieved 2 September 2014. Wikipedia revision 1354923960, retrieved 2026-11-18 · 1794956400.0
  7. ^ WORTH READING Wikipedia entry on SNOBOL — the TRUE story NOT Wikipedias Archived 2020-02-10 at the Wayback Machine (Dave Farber, Interesting People mailing list, 26 December 2008) Wikipedia revision 1354923960, retrieved 2026-11-18 · 1794956400.0
  8. ^ Computers and the humanities 1 :158, 1967. Wikipedia revision 1354923960, retrieved 2026-11-18 · 1794956400.0
  9. ^ Belzer, Jack; Holzman, Albert G.; Kent, Allen, eds. (1979). "SNOBOL" . Encyclopedia of Computer Science and Technology . Vol. 13. CRC Press. p. 173. ISBN 0-8247-2263-9 . Wikipedia revision 1354923960, retrieved 2026-11-18 · 1794956400.0
  10. ^ Gimpel, J. F. (February 1973). "A theory of discrete patterns and their implementation in SNOBOL4" . Communications of the ACM . 16 (2): 91– 100. doi : 10.1145/361952.361960 . S2CID 17059429 . Wikipedia revision 1354923960, retrieved 2026-11-18 · 1794956400.0
  11. ^ "Dr. Dobb's: Programs That Transform Their Own Source Code; or: the Snobol Foot Joke" . Dobbscodetalk.com . Retrieved 2011-12-04 . Wikipedia revision 1354923960, retrieved 2026-11-18 · 1322953200.0
  12. ^ Contact details. "perlre" . perldoc.perl.org . Retrieved 2011-12-04 . Wikipedia revision 1354923960, retrieved 2026-11-18 · 1322953200.0
  13. ^ "Recursive Regex Tutorial" . Retrieved 2017-03-19 . Wikipedia revision 1354923960, retrieved 2026-11-18 · 1489878000.0
  14. ^ Griswold, Ralph E.; Hanson, David R. (April 1977). "An Overview of SL5" . ACM SIGPLAN Notices . 12 (4): 40– 50. doi : 10.1145/954654.954658 . S2CID 38692673 . Wikipedia revision 1354923960, retrieved 2026-11-18 · 1794956400.0
  15. ^ See Chapter 1 of The Macro Implementation of SNOBOL4 Wikipedia revision 1354923960, retrieved 2026-11-18 · 1794956400.0
  16. ^ SNOBOL4 has been implemented using C to recreate the virtual machine instructions. Wikipedia revision 1354923960, retrieved 2026-11-18 · 1794956400.0
  17. ^ Griswold, Ralph (1978). "A history of the SNOBOL programming languages" (PDF) . ACM SIGPLAN Notices . 13 (8): 275– 308. doi : 10.1145/960118.808393 . S2CID 5413577 . Archived from the original (PDF) on 2019-03-02. Wikipedia revision 1354923960, retrieved 2026-11-18 · 1794956400.0
  18. ^ "SNOSTORM" , MTS Volume 9: SNOBOL4 in MTS , Computing Center, University of Michigan, June 1979, pages 99–120. Retrieved 1 September 2014. Wikipedia revision 1354923960, retrieved 2026-11-18 · 1794956400.0
  19. Wikipedia “SNOBOL” revision 1354923960 · retrieved 2026-10-20 release date (×1) · confidence 0.95 revision URL · 1792450800.0
source: e01 Encyclopedia · licence: CC BY-SA 4.0 · page · source revision

Cite this

"SNOBOL". 1779143329. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1354923960

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·