SNOBOL4(ID:303/sno005)

Classic SNOBOL 


Griswold et al, 1967. Quite distinct from its predecessors. Unix port of the original macro implementation
Declarative with dynamic scope.
Patterns are first-class data objects that can be constructed by concatenation and alternation. Success and failure used for flow control.
Delayed (unevaluated) expressions can be used to implement recursion. Table data type.



Structures:
Related languages
SNOBOL3 => SNOBOL4   Evolution of
SNOBOL4 => *n   Written using
SNOBOL4 => 1.pak   Positive Strong Influence
SNOBOL4 => BTL SNOBOL4   Renaming
SNOBOL4 => Buckle data structure language   Incorporated some features of
SNOBOL4 => CISBOL   Compiled by
SNOBOL4 => Criterion COBOL Compiler   Influence
SNOBOL4 => DASH   Incorporated some features of
SNOBOL4 => EASEy   Written using
SNOBOL4 => ESP³   Extension of
SNOBOL4 => EZ   Incorporated some features of
SNOBOL4 => FASBOL   Compiled by
SNOBOL4 => Fornax   Influence
SNOBOL4 => GRASPE   Extension of
SNOBOL4 => Icon   Evolution of
SNOBOL4 => NODAL   Incorporated some features of
SNOBOL4 => Pattern   Influence
SNOBOL4 => Poplar   Derivation of
SNOBOL4 => PUSHUP   Influence
SNOBOL4 => RATSNO   Preprocessor for
SNOBOL4 => Rebus   Evolution of
SNOBOL4 => SIL   Intermediate language for
SNOBOL4 => SIMPL   Written using
SNOBOL4 => SITBOL   Compiled by
SNOBOL4 => SIXBOL   Implementation
SNOBOL4 => SL5   Evolution of
SNOBOL4 => SNOBAT   Evolution of
SNOBOL4 => SNOBOL X   Augmentation of
SNOBOL4 => SNOBOL+   Extension of
SNOBOL4 => SNOBOL4B   Extension of
SNOBOL4 => SNOBOL-A   Augmentation of
SNOBOL4 => SNOBOLY   Extension of
SNOBOL4 => Snocone   Evolution of
SNOBOL4 => SP/1   Incorporated some features of
SNOBOL4 => SPITBOL   Compiled by
SNOBOL4 => S-Snobol   Evolution of
SNOBOL4 => Tamir SNOBOL   Augmentation of
SNOBOL4 => TEMPO   Influence

References:
  • Desautels, E. J. and Smith, D. K., "An Introduction to the String Manipulation Language SNOBOL" view details
          in Rosen, Saul (ed) Programming Systems & Languages. McGraw Hill, New York, 1967. view details
  • R. E. Griswold, J. F. Poage, and I. P. Polonsky, "Preliminary Description of the SNOBOL4 Programming Language," Bell Telephone Laboratories, Inc., Holmdel, New Jersey, S4D1. view details
          in Rosen, Saul (ed) Programming Systems & Languages. McGraw Hill, New York, 1967. view details
  • R. E. Griswold, J. F. Poage, and I. P. Polonsky, "Preliminary Report On The SNOBOL4 Programming Language," Bell Telephone Laboratories, Inc., Holmdel, New Jersey (November 22, 1967) S4D4 view details
          in Rosen, Saul (ed) Programming Systems & Languages. McGraw Hill, New York, 1967. view details
  • Anderson Eric E. and Roger Sturgeon "Interactive SNOBOL4 System for the SDS 940" University of California, Berkeley 1968 view details Extract: Description
    The SDS 940 SNOBOL4 system will accept programs written in a language which is basically compatible with a subset of Bell Labs' November 22, 1967 version of SNOBOL4. SNOBOL4 is not a superset of SNOBOL3 but is in most ways very similar to SNOBOL3. The major exception is in pattern matching and the pattern datatype. The SNOBOL4 system permits programs to be created, run and debugged interactively.
    The principal data object in the SNOBOL language is a string of characters. The language permits building up longer strings from shorter strings through concatenations. In addition, through pattern matching, strings can have their contents tested and have the matched substrings assigned to string variables.
    Other features of the language are arithmetic on integer strings, built-in functions for general use, and programmer defined functions which may have local variables and can be recursive to arbitrary depth. Input-output from files is provided as well as from the teletype.
    pdf
          in Rosen, Saul (ed) Programming Systems & Languages. McGraw Hill, New York, 1967. view details
  • R. E. Griswold, J. F. Poage, and I. P. Polonsky, "Preliminary Report On The SNOBOL4 Programming Language," Be|ll Telephone Labortories, Inc., Holmdel, New Jersey (March 20, 1968) S4D4b view details
          in Rosen, Saul (ed) Programming Systems & Languages. McGraw Hill, New York, 1967. view details
  • Balzer, R.W. et al, "APAREL: A Parse Request Language", view details Abstract: APAREL is described: this language is an extension to an algorithmic language (PL/I) that provides the pattern-matching capabilities normally found only in special purpose languages such as SNOBOL4 and TMG. This capability is provided through parse-requests stated in a BNF-like format. These parse-requests form their own programming language with special sequencing rules. Upon successfully completing a parse-request, an associated piece of PL/I code is executed. This code has available for use, as normal PL/I strings, the various pieces (at all levels) of the parse. It also has available, as normal PL/I variables, the information concerning which of the various alternatives were successful. Convenient facilities for multiple input-output streams, the initiation of sequences of parse-requests as a subroutine, and parse-time semantic checks are also included. APAREL has proven convenient in building a powerful SYNTAX and FUNCTION macro system, an algebraic language preprocessor debugging system, an on-line command parser, a translator for Dataless Programming, and as a general string manipulator. DOI
          in [ACM] CACM 12(11) (Nov 1969). view details
  • Macleod, IA "SP/1 - a FORTRAN integrated string processor" pp255-260 view details Extract: Introduction
    In general, string processing systems deal with data which
    is in the form of unstructured strings of characters.
    COMIT (Yngve, 1962), SNOBOL-3 (Farber, Griswold
    and Polansky, 1966) and SNOBOL4 (Griswold, Poage
    and Polansky, 1968) are three well-known string processing
    languages. Typical of the types of operation
    possible in these languages are matching, insertion,
    replacement and concatenation of strings and substrings.
    With the increasing usage of computers in many different
    fields, the distinction between numeric and non-numeric
    applications is becoming less apparent, as for example
    in information retrieval problems. Consequently it
    seems desirable that a single programming system should
    incorporate efficient numeric and non-numeric capabilities.
    The SP/1 system described here has been designed
    and implemented as a string processing system embedded
    in FORTRAN-IV.
    To avoid adding to the diversity of programming
    systems already in existence and since SNOBOL is a wellknown
    language whose syntax is readily adaptable to a
    FORTRAN environment, the operations provided in
    SP/I are similar to those available in SNOBOL-3.
    Unlike, for example DASH (Milner, 1967), which is a
    string processing extension embedded in ALGOL, SP/1
    is both a syntactic and semantic extension to FORTRAN.
    The string processing statements can be represented by
    a set of macros which are expanded into FORTRAN
    statements by a macro generator (Macleod and Pengelly,
    1969) prior to compilation. The macros have been
    designed so that there is a close similarity between the
    syntax of the corresponding SP/1 and SNOBOL3
    statements.
    For example, the SNOBOL-3 statement
    REPEAT E "(" *V* ")" = V /S (REPEAT)
    deletes all the pairs of left and right parentheses from a
    string E. The corresponding SP/I statement is
    In addition, SP/1 provides a data type known as an
    association which may have a range of alternative values
    associated with it. This data type is in some ways
    similar to the pattern type in SNOBOL-IV and the
    assertion type in AXLE (Cohen and Wegstein, 1965).
    A further distinctive feature of SP/1 is that strings are
    stored as sequences of atoms where an atom is the
    smallest meaningful unit of the string. The size of an
    atom is determined on input as shown below, but
    normally an atom may be regarded as a single character
    symbol or as a group of consecutive alphameric characters.
    The latter could be the case for example in text
    processing where one atom would be equivalent to a
    word of text. This approach allows the processor to
    operate on strings composed of text words while retaining
    the capability to manipulate strings of individual symbols
    where required. This provides faster operation with a
    considerable saving in storage requirements in the text
    processing types of applications where the smallest
    logical unit of information is a word of text. Thus,
    essentially, there are two modes of operation, character
    and text, corresponding to the two types of storage. In
    the current version of SP/1 mixed mode operations are
    not allowable. The method of string storage, which
    involves a hash table, is described elsewhere (Macleod,
    1969a). Extract: Introduction
    In general, string processing systems deal with data which
    is in the form of unstructured strings of characters.
    COMIT (Yngve, 1962), SNOBOL-3 (Farber, Griswold
    and Polansky, 1966) and SNOBOL4 (Griswold, Poage
    and Polansky, 1968) are three well-known string processing
    languages. Typical of the types of operation
    possible in these languages are matching, insertion,
    replacement and concatenation of strings and substrings.
    With the increasing usage of computers in many different
    fields, the distinction between numeric and non-numeric
    applications is becoming less apparent, as for example
    in information retrieval problems. Consequently it
    seems desirable that a single programming system should
    incorporate efficient numeric and non-numeric capabilities.
    The SP/1 system described here has been designed
    and implemented as a string processing system embedded
    in FORTRAN-IV.
    To avoid adding to the diversity of programming
    systems already in existence and since SNOBOL is a wellknown
    language whose syntax is readily adaptable to a
    FORTRAN environment, the operations provided in
    SP/I are similar to those available in SNOBOL-3.
    Unlike, for example DASH (Milner, 1967), which is a
    string processing extension embedded in ALGOL, SP/1
    is both a syntactic and semantic extension to FORTRAN.
    The string processing statements can be represented by
    a set of macros which are expanded into FORTRAN
    statements by a macro generator (Macleod and Pengelly,
    1969) prior to compilation. The macros have been
    designed so that there is a close similarity between the
    syntax of the corresponding SP/1 and SNOBOL3
    statements.
    For example, the SNOBOL-3 statement
    REPEAT E "(" *V* ")" = V /S (REPEAT)
    deletes all the pairs of left and right parentheses from a
    string E. The corresponding SP/I statement is
    In addition, SP/1 provides a data type known as an
    association which may have a range of alternative values
    associated with it. This data type is in some ways
    similar to the pattern type in SNOBOL-IV and the
    assertion type in AXLE (Cohen and Wegstein, 1965).
    A further distinctive feature of SP/1 is that strings are
    stored as sequences of atoms where an atom is the
    smallest meaningful unit of the string. The size of an
    atom is determined on input as shown below, but
    normally an atom may be regarded as a single character
    symbol or as a group of consecutive alphameric characters.
    The latter could be the case for example in text
    processing where one atom would be equivalent to a
    word of text. This approach allows the processor to
    operate on strings composed of text words while retaining
    the capability to manipulate strings of individual symbols
    where required. This provides faster operation with a
    considerable saving in storage requirements in the text
    processing types of applications where the smallest
    logical unit of information is a word of text. Thus,
    essentially, there are two modes of operation, character
    and text, corresponding to the two types of storage. In
    the current version of SP/1 mixed mode operations are
    not allowable. The method of string storage, which
    involves a hash table, is described elsewhere (Macleod,
    1969a).
          in The Computer Journal 13(3) view details
  • Michael D. Shapiro PhD Purdue CS 1970 "A SNOBOL Machine: Functional Architectural Concepts of a String Processor" Advisor: M. H. Halstead view details External link: Cite External link: Cite
          in The Computer Journal 13(3) view details
  • Griswold , Ralph E. et al, "The SNOBOL4 Programming Language"P-H 1971. view details
          in The Computer Journal 13(3) view details
  • Gimpel, James G "Blocks--A New Datatype for SNOBOL4" view details
          in [ACM] CACM 15(12) 1972 view details
  • Rosen, S. "Programming Systems and Languages 1965-1975" view details Abstract: In spite of impressive gains by PL/I, Fortran and Cobol remain the languages in which most of the world's production programs are written and will remain so into the foreseeable future. There is a great deal of theoretical interest in Algol 68 and in extensible languages, but so far at least they have had little practical impact. Problem-oriented languages may very well become the most important language development area in the next five to ten years. In the operating system area all major computer manufacturers set out to produce very ambitious multiprogramming systems, and they all ran into similar problems. A number of university projects, though not directly comparable to those of the manufacturers, have contributed greatly to a better understanding of operating system principles. Important trends include the increased interest in the development of system measurement and evaluation techniques, and increased use of microprogramming for some programming system functions. DOI
          in [ACM] CACM 15(07) (July 1972) view details
  • Sammet, Jean E. "Roster of Programming Languages for 1973" p147 view details
          in ACM Computing Reviews 15(04) April 1974 view details
  • Tennent, Robert D. "Mathematical Semantics of Snobol 4" pp95-107 view details Abstract: This paper analyzes the semantics of the programming language SNOBOL4, following the mathematical approach proposed by D. Scott and C. Strachey. The study aims at clarifying a rather unusual semantic structure, and at demonstrating that the mathematical approach can provide a natural and usable formal specification of a practical programming language. DOI
          in [ACM SIGACT-SIGPLAN] Proceedings of the ACM Symposium on Principles of Programming Languages, Boston, October 1973. Association for Computing Machinery. view details
  • Leavenworth, Burt M.; Sammet, Jean E. "An overview of nonprocedural languages" pp1-12 view details Abstract: This paper attempts to describe some of the basic characteristics and issues involving the class of programming languages commonly referred to as ?nonprocedural? or ?very high level?. The paper discusses major issues such as terminology, relativeness, and arbitrary sequencing. Five features of nonprocedural languages are described, and a number of specific languages are discussed briefly. A short history of the subject is included.

          in Proceedings of the ACM SIGPLAN symposium on Very high level languages, March 28-29, 1974, Santa Monica, California, United States view details
  • Griswold, Ralph E. "A Protable Diagnostic Facility for SNOBOL4" view details
          in Software — Practice and Experience 5(01) January 1975 view details
  • Lecarme, O. & Pellissier, Mireille "Implémentation du langage SNOBOL4 sur CII Iris 50" Technical Report, Nice, 1977 view details
          in Software — Practice and Experience 5(01) January 1975 view details
  • Ripley, G. David, Ralph E. Griswold, David R. Hanson: "Performance of Storage Management in an Implementation of SNOBOL4" pp130-137 view details
          in IEEE Transactions on Software Engineering (TSE) 4(2) 1978 view details
  • Sammet, Jean E "Roster of programming languages for 1976-77" pp56-85 view details
          in SIGPLAN Notices 13(11) Nov 1978 view details
  • Griswold, Ralph E.; Hanson, David R. "An Alternative to the Use of Patterns in String Processing" ACM Transactions on Programming Languages and Systems (TOPLAS) 2(2) (April 1980) pp153-172 1980 view details Abstract: SNOBOL4 is best known for its string processing facilities, which are based on patterns as data objects. Despite the demonstrated success of patterns, there are many shortcomings associated with their use. The concept of patterns in SNOBOL4 is examined and problem areas are discussed. An alternative method for high-level string processing is described. This method, implemented in the programming language Icon, employs generators, which are capable of producing alternative values. Generators, coupled with a goal-driven method of expression evaluation, provide the string processing facilities of SNOBOL4 without the disadvantages associated with patterns. Comparisons between SNOBOL4 and Icon are included and the broader implications of the new approach are discussed.
    DOI
          in SIGPLAN Notices 13(11) Nov 1978 view details
  • Lecarme, O. "Une famille de langages de programmation : Snobol, SL5 et Icon" pp111-154 view details
          in RAIRO - Informatique, 15(2) 1981 view details
  • Casanova, M. A. and A. L. Furtado "String pattern-matching in Prolog" view details
          in Computer Languages 13(3-4) view details
  • Liu, K.-C. "On String Pattern Matching: a Quantitative Analysis and a Proposal" view details
          in Computer Languages 13(1) view details
  • Hechler, L.; Huebner, H.; Krause, U. "The NODAL Interpreter at GSI" GSI, Gesellschaft fur Schwerionenforschung mbH 23 Feb 1989 view details Extract: History
    History
    NODAL was designed in the beginning 70's at CERN in Geneva as a flexible and easy to handle tool for controlling the SPS accelerator.
    In NODAL features of FOCAL and SNOBOL-4 (with some influence of BASIC) are combined.

    The first implementation was written in assembler for the NORD-10 minicomputer, now an assembler version for the NORD-100 exists too. Many of these computers are interconnected in a homogeneous network. Each of these nodes may be used to execute NODAL programs whereby exchange of NODAL statements and NODAL data between the different computers is possible.

    In the control of the new accelerator LEP other processors than for the SPS are used for which the existing assembler implementations of NODAL cannot be adapted easily. Since NODAL was found to be very useful at testing, during running-in and in all situations where flexible response was required, it was desirable to have NODAL also available for LEP. To overcome the limitations of assembler programs when adapting them to different processors it was decided to create a new version, written in a portable language. The choice was MODULA-2, since for this language compilers are available for all computers used.
    When designing the control system for the new GSI accelerators, the Prozessrechnergruppe was looking for an interpreter for accelerator control. Because of the portability of the new NODAL version it was decided to cooperate with CERN and use NODAL also at GSI. Extract: Characteristics of NODAL
    Characteristics of NODAL
    Contrary to other interpreters NODAL is emphasized by the following characteristics:
     integrated elements for access to equipment, called data-modules.
     parts of programs can be exported to run on another computer and results of calculations can be received (not implemented in GSI-version).
     output of programs and data to files (and also to other computers) is formatted uniformly.

    Thus it is possible to store programs and data in one file.

    Special features of the MODULA-2 version of NODAL are:
     The separation into kernel modules (processor independent) and target modules (processor dependent) eases the adaptation to different types of processors. When transferring NODAL to another processor, only the target modules like file input/output, error handling, operating system access etc. have to be modified. Actually modules exist (or are under work) for MC68000, VAX/VMS, VAX/UNIX, NORD-100, LILITH, TMS9900, IBM-PC.
     Execution is faster than in the previous assembler versions. This is achieved by generating an intermediate code which is used after first execution of a program. Thus lexical and syntax analysis has to be done only once which speeds up repitative parts of NODAL programs. To calculate arithmetic expressions it is planned to install a 'throw-away' compiler. pdf
          in Computer Languages 13(1) view details
  • Nilsen, K. "A stream data type that supports goal-directed pattern matching on unbounded sequences of values" view details
          in Computer Languages 15(1) view details
  • Shapiro, Michael: Usenet posting on comp.compilers on COBOL compilers view details External link: online copy Extract: USENET Posting
    Many years ago I headed up a COBOL compiler project for NCR for the then-new VRX systems, which included a "COBOL Virtual Machine" object code set. We produced a "tagged architecture" machine COBOL as a low-level machine language. (My thesis research on a SNOBOL machine contributed some features to the product.) I wrote this up in a paper for the 1978 Fall Joint Computer Conference ("The Criterion COBOL Compiler"). It discusses the approach we took and some of the problems we ran into.

    The compiler itself was relatively straight-forward, much like a text-book example. (The fact that I was teaching compiler construction at San Diego State University at the time may have influenced my approach.) We compiled the DATA DIVISION statements into descriptors which were handled by the runtime firmware.

    Incidentally, we were one of the first COBOL'74 compilers to go through the Federal COBOL Compiler Validation Service testing. They found only four problems: two console I/O interpretation questions and two incorrect level diagnostics. My COBOL background before coming to the project was one program in a programming languages course. I later wrote a couple of more programs as tests, which made me an expert among most computer scientists! I still have a reading knowledge of the language

          in Computer Languages 15(1) view details
    Resources