SAIL (programming language)

SAIL (programming language)
SAIL, the Stanford Artificial Intelligence Language, was developed by Dan Swinehart and Bob Sproull of the Stanford AI Lab. It was originally a large ALGOL 60-like language for the PDP-10 and DECSYSTEM-20. The language combined the earlier PDP-6/-10 language GOGOL compiler, essentially an integer-only version of ALGOL, with the associative store from the LEAP language. The first release was in November 1969 and it saw continued development into the 1980s, including a commercial derivative, MAINSAIL.
SAIL's main feature is a symbolic data system based upon an associative store based on LEAP by Jerry Feldman and Paul Rovner. Items may be stored as unordered sets or as associations (triples). Other features include processes, procedure variables, events and interrupts, contexts, backtracking and record garbage collection. It also has block-structured macros, a coroutining facility and some new data types intended for building search trees and association lists.
History
The GOGOL compiler was originally written by Bill McKeeman on the PDP-1. It was essentially an integer-only version of ALGOL-60 with a number of additions to provide direct access to the memory and other hardware to allow it to be used as a systems programming language. It reduced arrays to a single dimension, removed any ability to perform dynamic memory allocations, but did add some additional string functionality. A greatly updated version by John Sauter, GOGOL II, was written as part of a port of the underlying operating system from ODIN to THOR. When the Stanford AI Lab received their PDP-6, Sauter, Pettit and (mostly) Dan Swinehart wrote GOGOL III for the new machine.
Swinehart, joined by Robert Sproull, merged the GOGOL syntax with additions from the contemporary versions of the LEAP language language to produce the first version of SAIL in November 1969. The main feature of LEAP as a language was its use of associative storage, more commonly known today as a Map or Dictionary. In LEAP, one could set the value of a field in a type using a triple, with the first entry being the variable name, the second being the field name, and the third the value.
Further improvements were added by Russell Taylor, Jim Low and Hana Samet, who added processes, procedure variables, interrupts, context, matching procedures, a new macro system, and other features. Development then passed to Taylor, John Reiser and Robert Smith, who added a debugger, a system-level print statement, records, and performed the conversion from Standord's own SUAI to TENEX. It was later ported to DEC's TOPS-10 as well, while the original TENEX version worked without modification under TOPS-20.
Description
Like many ALGOL systems, and the later Pascal, the basic structure of SAIL is based on the block, which is denoted by the code between the keywords and . Within a block there is further structure, with the declarations of local variables at the top, if any, and the code, or statements, following. In contrast to most dialects, SAIL allowed one to place a string after the , like , and then end the block with . The compiler would use these, if entered, to check for proper bracketing.
The basic variable types in SAIL are integers, reals (floating point), booleans, and strings. Any of these types can be turned into an array by adding the qualifier and placing the array bounds in brackets, for instance, . SAIL supported 1-d and 2-d arrays. Type conversions were automatic, so would convert the value 5 to a double as that is what SQRT requires.
Standard statements included for top-tested loops, for bottom-tested, and which used a label. A curious statement was , which took an integer value and then ran one of the following statements, like , which returns the appropriate string based on the value of i. exited from a block, typically used in loops, and returned to the top of the block. An infinite loop was typically implemented with .
Procedures were implemented in a fashion similar to the C programming language, with the return type, if any, in front of the name, for instance, . Note the uncommon use of the semicolon here, whereas PASCAL would immediately follow with a block, typically a . In order to improve performance, SAIL added two qualifiers, and . If a procedure did not specifically say , when the procedure was called it would not create an activation record, thereby improving performance. SAIL also included the qualifier, used to insert forward declarations, typically when two procedures call each other. worked as in C, both exiting the procedure and returning to the caller, as well as returning a value if the procedure uses one. Parameters passed to the procedures could be by or , the later allowing values to be passed back.
As a systems programming language, performance was important and to help with this, SAIL included a which used string-replacement in a fashion similar to C's macros. A difference was that the delimiters around the substitution had to be defined, for instance . One common use of these macros was to define character constants like , as these were not part of the basic language. Another was to redefine the statement to the shorter .
The language used the left-arrow for assignment, or the underscore on platforms that did not have Stanford ASCII. It included a number of standard functions like square root, all of the common math operators, and was otherwise similar to most ALGOL derivatives for normal programming.
Strings were manipulated using array slicing, with returning the substring with characters from i to j, or which returned the substring starting at i and running for j characters. The (inity) keyword represented the end of the string, so one could to return everything from i on. String functions and operators included for testing if two strings were equal the ampersand for concatenation, and which removes the first character from the string.
Uses
A number of interesting software systems were coded in SAIL, including some early versions of FTP and TeX, a document formatting system called PUB, and BRIGHT, a clinical database project sponsored by the National Institutes of Health.
In 1978, there were half a dozen different operating systems for the PDP-10: ITS (MIT), WAITS (Stanford), TOPS-10 (DEC), CMU TOPS-10 (Carnegie Mellon), TENEX (BBN), Tymcom-X (Tymshare), and TOPS-20 (DEC, based on TENEX).
SAIL was ported from WAITS to ITS so that MIT researchers could make use of software developed at Stanford University. Every port usually required the rewriting of I/O code in each application.
A machine-independent version of SAIL called MAINSAIL was developed in the late 1970s and was used to develop many eCAD design tools during the 1980s. MAINSAIL was easily portable to new processors and operating systems, and was still in limited use .
See also
Stanford Extended ASCII (SEASCII)
References
Bibliography
Further reading
External links
Documentation for MAINSAIL.
A SAIL Tutorial from the DECUS PDP-10 library tapes
Stanford Artificial Intelligence Lab Memo AIM-289/SAILON 57.4: SAIL Manual August 1976
Algol programming language family
Systems programming languages