ArticleslgStudy

science

SAIL (programming language)

SAIL (programming language) is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand SAIL (programming language) rather than just read about it. In short: 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.

Key takeaways

  • SAIL (programming language) belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect SAIL (programming language) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of SAIL (programming language) from memory before moving on to harder problems.

Reference excerpt

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.

Worked examples

Example 1 — a first encounter with SAIL (programming language)

Start with the simplest possible case. Write down what SAIL (programming language) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to SAIL (programming language) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about SAIL (programming language) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of SAIL (programming language)

In research
SAIL (programming language) appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses SAIL (programming language) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
SAIL (programming language) is common in secondary-school and first-year university syllabi. It links to neighbouring topics Algol programming language family, Systems programming languages, so understanding it makes those chapters shorter.
In everyday life
Look for SAIL (programming language) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “SAIL (programming language)” →

How to study SAIL (programming language) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what SAIL (programming language) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain SAIL (programming language) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is SAIL (programming language) in simple terms?

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.

Why does SAIL (programming language) matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study SAIL (programming language)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on SAIL (programming language).

Tags

  • Algol programming language family
  • Systems programming languages

Keep exploring