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 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
Basic structure and statements 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 BEGIN and END. 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 BEGIN, like BEGIN "program", and then end the block with END "program". The compiler would use these, if entered, to check for proper bracketing. SAIL did not include the equivalent of a PROGRAM block as in Pascal, nor a main as in C, execution started with the first line of code in the outermost block. Standard statements included IF...THEN...ELSE, FOR...STEP...UNTIL...DO, WHILE...DO for top-tested loops, WHILE...UNTIL for bottom-tested, and GOTO which used a label. The CASE was similar to switch in C, but normally used a somewhat different syntax, like CASE i OF ("Zero","One","Two");, which returns the appropriate string based on the value of i. If one wanted to test explicit values in the CASE, the values had to be in square brackets:
This code will ignore values like 1 to 3, and only return a value for the listed values. Note that the last item cannot have a semicolon following. DONE exited from a block, typically used in loops, and CONTINUE returned to the top of the block. An infinite loop was typically implemented with WHILE TRUE DO....
Procedure declarations 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, STRING PROCEDURE toUpper(STRING originalStr);BEGIN.... Note the uncommon use of the semicolon here, whereas Pascal would immediately follow with a block, typically a BEGIN. In order to improve performance, SAIL added two procedure qualifiers, SIMPLE and RECURSIVE. RECURSIVE told the compiler that the procedure might call itself, and thus its local variables had to be written to the stack, not just the subroutine return information. SIMPLE did the opposite, demanding the procedure have no local variables at all, not allowing GOTO out of the function, and could not refer to enclosing procedure's variables. These directives could avoid the requirement of filling out a complete activation record, thereby improving performance. This also had the side-effect of meaning that variables declared within a procedure that was not marked RECURSIVE would not be reset between calls, acting similar to C's static. SAIL also included the FORWARD qualifier, used to insert forward declarations, typically when two procedures call each other. RETURN worked as in C, exiting the procedure and returning to the caller, as well as optionally returning a value if the procedure uses one. Parameters passed to the procedures could be by VALUE or REFERENCE, the later allowing values to be passed back.
… excerpt ends here. Continue reading the full article.