SNAP, short for Stylized, Natural, and Procedural, is an educational programming language designed by Michael Barnett while working at RCA in 1968 and later used at Columbia University to teach programming in the humanities. It is an imperative programming language, like many languages of the 1960s, but was deliberately verbose, attempting to look more like conversational English in the fashion of HyperText and later languages. Unlike other educational languages of the era, SNAP was not intended to be interactive and was designed to be programmed via punch cards. To save cards, multiple period-separated statements could be written on every card, so the resulting code often looked like a single paragraph.
History In 1964, Michael Barnett joined RCA's newly-formed Graphic Systems Division which had been formed to commercialize the photo-typesetting technology they had licensed from Rudolf Hell. Originally known as Digiset, RCA sold the systems under the name Videocomp. About 50 Videocomp systems were sold over its history. In 1964 and 1965, Barnett developed a page description language known as PAGE-1 to write programs that resulted in Videocomp output, similar to the way the later PostScript language produces pages on laser printers. One of the early applications of this system was to publish Social Sciences Index by the H. W. Wilson Company. This led to Barnett's interest in the social sciences and his increasing interactions with H. W. Wilson and Columbia University's humanities department. Barnett took a position at H. W. Wilson in 1969. He had also started to teach courses on library automation at the Columbia School of Library Service, and in 1970, computer programming in the humanities. He joined the Columbia faculty full-time in 1975. The first version of SNAP was written by William Ruhsam of RCA in FORTRAN IV for the RCA Spectra 70, although a version for the IBM 360 in OS-360 was also produced. some time in 1967 or 1968. The language generated a fair amount of comment, especially in the early 1970s, but appears to have had little direct influence on later languages.
Description
General concepts SNAP allowed multiple statements to be placed on a single line, and used the period as the statement separator. This produced code that looked like English sentences, and was generally organized into blocks that looked like paragraphs. SNAP did not use line numbers for editing, and instead used in-code labels for branch targets, as was the case in FORTRAN. In SNAP, a label could be placed anywhere in the code by surrounding the textual name in parentheses like (FIRST LABEL). Labels were not separate statements, and did not require a period after them. Variables names could contain spaces, which is relatively rare for programming languages even today. Variables could hold strings or numbers, but different syntax was used to assign each one. For numbers, a simple syntax was used, SET I TO 1. SET was also used to perform mathematical operations, like SET I TO THE PRODUCT OF 10 AND J. A simpler syntax was offered for the more common increment and decrement operations, INCREASE M BY 1. or DECREASE M BY 2. For strings, a longer syntax was typically used, CALL "THIS IS A STRING" THE NEWSTRING. Substrings were accessed using a HyperTalk-like syntax by referring to the ordinal position, for instance, CALL THE J-TH CHARACTER OF NEWSTRING THE NEWCHAR., or CALL THE M-TH THROUGH N-TH CHARACTERS OF THE INPUT THE OUTPUT. SNAP also offered array-like collections known as "lists". Internally, these were stored as comma-delimited strings. Most of the string-related commands could be used to work with these by adding THE ... LIST. to the end. For instance, one could read a series of cards using READ THE CARD LIST., which would read each card as a separate string into the CARD variable. Items within a list were accessed using the same ordinal syntax, for instance PRINT THE 5-TH CARD, or COPY "NEW STRING" AND CALL IT THE 7-TH CARD. Lists of numbers could be created using SET THE NUMBER LIST TO 1,2,3,4,5. String variables can also be used as lists, or arrays. This was accomplished using the same ordinal position syntax but referring to the variable name and not the CHARACTER. For instance, CALL "HELLO" THE 1-ST PART. CALL "WORLD" THE 2-ND PART. would create an array called PART with two strings in it. An important point of the SNAP system is that the CALL statement is not static; it does not define KEY as the character at location J when it is encountered in the code, but when any following code accesses KEY. For instance, SET J TO 1. PRINT KEY. INCREASE J BY 1. PRINT KEY. would result in two different strings being printed. In this fashion, CALL has more in common with the BASIC programming language's DEF FN user-defined functions than it does with the SET statement, which is static. A static copy of a string could be made by COPY OLDSTRING, AND CALL IT NEWSTRING. Other string functions included APPEND one string TO another string., OVERWRITE string-expression ON THE M-TH [AND SUBSEQUENT] CHARACTER[S] OF string-name., DELETE THE M-TH [THROUGH N-TH] CHARACTER[S] OF string-name. and INSERT string-expression (BEFORE|AFTER) THE M-TH CHARACTER OF string-name. Unconditional branches were called using CONTINUE, for instance, CONTINUE WITH THE FIRST LABEL. There was also the alternative form REPEAT THE FIRST LABEL.. There was no difference between them, although the context of the surrounding code generally meant one form or the other was more natural to read. One could also refer to the start of the program with CONTINUE FROM THE BEGINNING. "As follows" could be used to refer to the next statement, CONTINUE AS FOLLOWS., which could be used to clarify branches. Conditional branches used an if–then(–else) structure:
As in most languages, the OTHERWISE section was optional. Note the use of AND to make a compound statement within the then section, offering a block structure. For string comparisons, one used IS or the optional IS THE SAME AS. SNAP included a number of other keywords that had no behaviour of their own that were added simply for syntactic sugar. Among them were THE, A, FROM which the programmer could add in many locations to make the syntax more readable. Typical uses included READ A RECORD and REPEAT FROM THE LOOP START.
… excerpt ends here. Continue reading the full article.
