Updated 2011-09-28 21:23:00 by escargo

"Multics (Multiplexed Information and Computing Service) is a mainframe timesharing operating system begun in 1965 and used until 2000. Multics began as a research project and was an important influence on operating system development. The system became a commercial product sold by Honeywell to education, government, and industry." http://www.multicians.org/multics.html

Though it died an unpretty death, Multics provided numerous ideas that Unix built on - the Unix name itself was a pun of Multics. Even if less known, this is part of the Tcl heritage.

These clippings from "The Multics Command Language" ([1]) sound as if they were about early Tcl:

The Command

A command is a sequence of zero or more elements. The first element is interpreted as the name of the command program and any additional elements are arguments. The normal command program will expect input arguments which are fixed length character strings, and return a value which is a varying character string. If the command program does not expect arguments in this form the command language interpreter, the Shell, will convert the type of the arguments according to information contained in the symbol table for the command program. The elements of a command are separated by spaces and terminated by a semicolon or a new line character. For example, to change the name of a file from "a" to "b", using the change_name command, a user would type
 (1)       change_name a b


The simplest type of element is a string of characters not containing any spaces or other characters reserved by the command language. The semicolon and new line characters are reserved. Other reserved characters will be identified as they are encountered. The three elements in example 1. at the end of the previous section are the simple character strings "change_name", "a", and "b".

Any element (or part of an element) may be a command. The user can tell the interpreter to evaluate an element as a command by surrounding the element with brackets (which are reserved characters). For example in
 (2)       change_name  [oldestfile]  b

the second element is a command. When an element is evaluated is a command, the result of that evaluation (i.e., the returned value of the function) replaces the original element. Suppose that the command "oldestfile" returns as its value the name of the oldest file in the users' directory, then example 2 changes the name of the oldest file to "b". In this case, the first argument to the command program change name is the character string returned by the command program "oldestfile" and the second argument is the character string "b".

Note that the spaces before and after the brackets are necessary to indicate that the result of "oldestfile" is an element and not a portion of an element. Suppose that the user had a program "me" which returned as its value his default working directory, (e,g., "me" would return a character string of the form ">user_dir_dlr>Southworth.MAC").

Other features are more than we have in Tcl, and interesting to look at: "More than one iteration set may appear in a command. All possible combinations will be executed. For instance, the compound command
          (print delete)   xyz(.epl .eplbsa);

would expand into the commands:
          print  xyz.epl
          print  xyz.eplbsa
          delete xyz.epl
          delete xyz.eplbsa

The Multics command language introduced the -option syntax for separating option names from option values. (In Multics jargon, these were called control arguments.) Control arguments often had both long and short names, like -home_dir and -hd (think -foreground and -fg).

Because the language did not use {} to quote text, text that contained quotation marks had to use quote doubling. So a command to the abbrev processor to define a command name check might look like this:
 .ab check do "if [[compare &1 &2]] -then ""delete &2"" -else ""fo check; cpa &1 &2; ro; dp -dl check"""

This means (to parse this)

  1. .ab - command for the abbrev processor to define
  2. check - the name of the command to define
  3. do - taking the quoted string that immediately follows, substitute parameters that follow into the positions as indicated, i.e., parameter 1 is substituted where &1 appears, etc.
  4. if - test a condition and then perform one of two actions
  5. compare - compare of two seqments for equality and return a boolean result
  6. -then - the command(s) to execute on a "true" comparison
  7. delete - delete the segment indicated
  8. -else - the command(s) to execute on a "false" comparison
  9. fo check - send output normally sent to standard_output to the file named "check"
  10. cpa - do a compare_ascii of the two segments (think Unix diff)
  11. ro - revert_output from "check" back to the console
  12. dp - daemon print' the file named "check", deleting it when done.

The set of 314 Multics Standard Service System commands as of 1980 is listed, and very briefly documented, at http://www.multicians.org/multics-commands.html .

A 38.5 megabyte PDF file containing a scanned of the Multics Commands manual, AG92, is available [2].

escargo 11 Apr 2005 - This synopsis does not mention how commands can be combined. Multics had both commands and active functions, which return results when run.

Active functions were surrounded by square brackets when invoked. - RS: Isn't it clearly enough stated (pasted) that "The user can tell the interpreter to evaluate an element as a command by surrounding the element with brackets (which are reserved characters)" ? :)

escargo 13 Apr 2005 - I had wanted to give a more complete example (like maybe Towers of Hanoi), but I didn't have the time. One significant difference between Tcl and Multics active functions is that the returned text is rescanned to look for more active function invocations. There is some magic defined somewhere to tell the command processor that the current invocation is a passive function and should not be rescanned. This makes Multics active functions more like macro processing in some macro languages.

Dave Griffin 15 Apr 2005 - The Multics pages state that their active functions came from TRAC, which RS has explored herein.

escargo 18 Apr 2005 - No denying it, but the Multics command language had both square brackets and a handling of unknown functions that TRAC did not have.

escargo 3 Apr 2008 - Multics software has apparently been released under and open source license: http://www.opensource.org/licenses/multics.txt