Origins and development
TUTOR was originally developed as a special purpose authoring language for designing instructional lessons, and its evolution into a general purpose programming language was unplanned. The name TUTOR was first applied to the authoring language of the PLATO system in the later days of Plato III. The first documentation of the language, under this name, appears to have been ''The TUTOR Manual'', CERL Report X-4, by R. A. Avner and P. Tenczar, Jan. 1969. The article ''Teaching the Translation of Russian by Computer'' gives a snapshot of TUTOR from shortly before PLATO IV was operational. Core elements of the language were present, but commands were given in upper case, and instead of using a general mechanism, support for alternative character sets was through special command names such asWRUSS
for "write using the Russian character set."
Through the 1970s, the developers of TUTOR took advantage of the fact that the entire corpus of TUTOR programs were stored on-line on the same computer system. Whenever they felt a need to change the language, they ran conversion software over the corpus of TUTOR code to revise all existing code so that it conformed with the changes they had made.
As a result, once new versions of TUTOR were developed, maintaining compatibility with the PLATO version could be very difficult.
Control Data Corporation (CDC), by 1981, had largely expunged the name TUTOR from their PLATO documentation. They referred to the language itself as the ''PLATO Author Language''. The phrase ''TUTOR file'' or even ''TUTOR lesson file'' survived, however, as the name of the type of file used to store text written in the PLATO Author Language.
Structure of a TUTOR lesson
A TUTOR lesson consists of a sequence of ''units'' where each unit begins with the presentation of information and progress from one unit to the next is contingent on correctly answering one or more questions. As withdo
or join
commands.
Here is an example unit from page 5 of the ''TUTOR User's Memo'', March 1973 ( Computer-based Education Research Laboratory, University of Illinois at Urbana-Champaign):
write
command above, the tag may consist of multiple lines. Continuation lines are either blank or have a leading tab.
* Screen coordinates are presented as single numbers, so 205 refers to line 2 column 5, and 413 refers to line 4 column 13.
What may not be apparent is the control structure implicit in this unit. The arrow
command marks the entrance to a ''judging block'' This control structure is one of TUTOR's unique features.
Unique features
TUTOR contained a number of unique features. The following list is not intended as a substitute for a TUTOR manual, but merely highlights the most interesting, innovative, and sometimes confusing features of the language.Answer judging
A ''judging block'' in TUTOR is a control structure that begins with anarrow
command and ends with the next arrow
, endarrow
or unit
command. The arrow
command also prompts for input, with the special arrow character (resembling "▷") displayed as a prompt at the indicated screen coordinates. In effect, a judging block can be thought of as a backtracking control structure where the student may make multiple attempts to answer a question until a correct answer allows forward progress.
Judging pattern matching
Each judging block consists of a sequence ofanswer
and wrong
. These had identical pattern matching semantics except that answer
judged a student response to be correct if it matched, while wrong
judged a student response to be incorrect.
The tag fields on the answer
and wrong
commands consisted of lists of optional, required and alternative words. consider this example from exercise 4-1 in the 1973 ''TUTOR User's Memo'':
specs
command to set how pedantic the system was about spelling errors.
The pattern matching algorithms used by various TUTOR implementations varied in detail, but typically, each word in the input text and each word in the pattern were converted to bit vectors. To see whether a word of student input matched a word of the pattern, the Hamming distance between the two bit vectors was used as a measure of the degree of difference between the words. Bit vectors were typically 60 or 64 bits long, with fields for letter presence, letter pair presence, and the first letter. As a result, the number of one bits in the Judging control structures
All early presentations of the control structure of a TUTOR judging block were confusing. In modern terms, however, a judging block can be described as an iterative control structure that exits when the student input is judged correct. The body of this control structure consists of a series of cases, each introduced by aanswer
or wrong
. All output produced by the body of the judging loop in the
previous cycle is erased from the screen prior to the next cycle.
Consider this example, from exercise 4-1 of the 1973 ''TUTOR User's Memo'':
join
command was a unique form of subroutine call. It was defined as being equivalent to textual substitution of the body of the joined unit in place of the join command itself (page 21, 1973 ''TUTOR User's Memo''). As such, a joined unit could contain part of a judging block. Thus, while the judging block is conceptually an iterator enclosing a series of cases, this block may be arbitrarily broken into subroutines. (An alternative subroutine call, the do
command, conformed to the usual semantics associated with subroutine calls in other programming languages.)
Graphic and display commands
The PLATO IV student terminal had a 512 by 512Drawing commands
The following example illustrates some of Tutor's drawing commands.draw
command. This allows unambiguous use of comma-separated fine coordinates. Normally, the draw command connects consecutive points with line segments, but by putting skip
in the tag, the draw
command could be made to conceptually lift its pen.
The tags on the circle
command give the radius and fine coordinates of the center. Additional tags could specify starting and
ending angles for partial circles.
Hand composing draw commands is difficult, so a picture editor was included in the PLATO system by 1974 to automate this work. This could only deal with drawing commands with constant coordinates.
Text rendering commands
The following example illustrates some of the text rendering tools of Tutor.Control structures
Aside from its unique answer judging mechanisms, TUTOR's original set of control structures was rather sparse. In the mid 1970s, this shortcoming was addressed by introducingif
, endif
blocks with optional elseif
and else
sections. The semantics of these control structures was routine, but the syntax inherited the mandatory indentation of the Tutor Language, presaging that of Python and adding a unique nonblank indent character to distinguish indenting from continuation lines.
This is illustrated in the following example, from page S5 of the ''Summary of TUTOR Commands and System Variables (10th ed)'' by Elaine Avner, 1981:
calc
statement is not rendered correctly in some browsers. It appears similar to <= but as one character. It had a dedicated key on the PLATO IV keyboard.)
The same syntax was used for loop
, endloop
blocks with semantics comparable to reloop
and outloop
commands are somewhat analogous to the continue
and break
statements of languages based on C, except that they must sit at the indenting level of the loop they modify, and they have a condition tag that indicates when the indicated control transfer is to take place. This makes the construct more powerful than in other languages, because any line of the inner loop could terminate or reloop several outer loops with one statement.
Expression syntax
TUTOR's expression syntax did not look back to the syntax of FORTRAN, nor was it limited by poorly designed character sets of the era. For example, the PLATO IV character set included control characters for×
and ÷
, but in a more radical departure from the conventions established by FORTRAN, it allowed implicit multiplication, so the expressions (4+7)(3+6)
and 3.4+5(23-3)/2
were valid, with the values 99 and 15.9, respectively (op cit). This feature was seen as essential. When students typed in a numeric answer to a question, they could use operators and variables and standard algebraic notation, and the program would use the TUTOR "compute" command to compile and run the formula and check that it was numerically equivalent (or within the floating point roundoff error) to the correct answer.
The language included a pre-defined constant named with the Greek letter pi (π), with the appropriate value, which could be used in calculations. Thus, the expression πr2
could be used to calculate the area of a circle, using the built-in π constant, implicit multiplication and exponentiation indicated by a superscript.
In TUTOR, the floating-point comparison x=y
was defined as being true if x
and y
were approximately equal (see page C5 of ''PLATO User's Memo, Number One'' by Avner, 1975). This simplified life for mathematically naïve developers of instructional lessons, but it occasionally caused headaches for developers of numerically sophisticated code because it was possible that both x<y
and x≥y
could be true at the same time.
Memory management
As an authoring language, TUTOR began with only minimal memory resources and only the crudest tools for manipulating them. Each user process had a private data segment of 150 variables, and shared ''common blocks'' could be attached, allowing inter-user communication through shared memory. On the PLATO IV system, words were 60 bits, in keeping with theBasic memory resources
The private memory region of each process consisted of 150 words each, referred to as student variables; the values of these variables were persistent, following the individual user from session to session. These were addressed asn1
through n150
when used to hold integer values, or as v1
through v150
when used to hold floating point values.
A TUTOR lesson could attach a single region of up to 1500 words of shared memory using the common
command. Each lesson could have an unnamed temporary common block containing variables shared by all users of that lesson. Such blocks were created when a lesson came into use and deallocated when the lesson became inactive. In contrast, named common blocks were associated with a block of a lesson (a disk file). Shared memory was addressed as nc1
through nc1500
(for integers) or vc1
through vc1500
(for floating point numbers).
Where 150 student variables was insufficient, a lesson could use the
storage
command to create an additional private memory segment of up to 1000 words. This segment existed in swap space only, but it could be mapped to student variables or common variables. For example (from page X-11 of ''The TUTOR Language'', Sherwood, 1974):
nc1
to nc1000
as a shared unnamed common block, while nc1001
to nc1075
are private storage.
Defining symbolic names
The Tutordefine
command was very similar to the C #define
preprocessor directive. This was the only way to associate mnemonic names with variables. It was up to the programmer to statically allocate memory and assign names to variables. Consider this example from page 17 of the ''TUTOR User's Memo -- Introduction to TUTOR'', 1973"
mynames
defining three floating point variables. Users were advised that "there should not be any v3's or v26's anywhere in your lesson except in the define
statement itself. Put all your definitions at the very beginning of the lesson where you will have ready reference to which variables you are using." (underlining from the original, page IV-5 of ''The TUTOR Language'', Sherwood, 1974.)
Functions could be defined, with macro-substitution semantics, as in this illustration from page IX-2 of ''The TUTOR Language'', Sherwood, 1974:
a
used above must not have any previous definition.
Later in the development of TUTOR, with the introduction of multiple named sets of definitions, the programmer was given explicit control over which sets of definitions were currently in force. For example, define purge, setname
would discard all definitions in the named set.
Arrays, packed arrays, and text manipulation
The original TUTOR tools for text manipulation were based on commands for specific text operations, for example,pack
to place a packed character string into consecutive variables in memory, search
to search for one string within another, and move
to move a string from memory to memory. By 1975, more general tools for arrays of integers and packed arrays were added. Page 14 of ''PLATO User's Memo -- Summary of TUTOR Commands and System Variables'', Avner, 1975, gives the following:
segment
, were comparable to packed arrays in Pascal. The byte size and whether or not the array elements were to be treated as signed or unsigned were entirely under user control. Arbitrary text manipulation could be done by setting the byte size to the machine byte size, 6 bits on implementations using display code, 8 bits on some later Parameter passing
A general parameter passing mechanism was added to TUTOR early in the PLATO IV era. Page IV-10 of ''The TUTOR Language'' by Sherwood, 1974 gives the following example:unit
command are simply the defined names for statically allocated global variables. The semantics of parameter passing was given as being equivalent to assignment at the time of the control transfer to the destination unit, and if actual parameters were omitted, as in the second do
command above, the effect was to leave the prior values of the corresponding formal parameters unchanged.
Local variables
Local variables were added to TUTOR some time around 1980. Lesson authors wishing to use local variables were required to use thelvars
command to declare the size of the buffer used for local variables, up to 128 words.Page C3 of ''Summary of TUTOR Commands and System Variables'', Avner, 1981 Having done so, a unit using local variables could begin as follows (from Page C2 of ''Summary of TUTOR Commands and System Variables'', Avner, 1981):
unit
command given above are taken to be lines of an implicit define
command with local n150
could be used in such a local define
, but the forms illustrated here all automatically bind names to locations in the block of memory allocated by the lvars
command. The available TUTOR documentation does not discuss how local variables are allocated.
Other implementations
There has been a sizable family of TUTOR-related languages, each similar to the original TUTOR language but with differences. In particular, TUTOR was a component of a system (the PLATO computer-based education system) that ran on particular CDC mainframe hardware. For efficiency, there were some hardware-specific elements in TUTOR (e.g. variables that were 60-bit words that could be used as arrays of 60 bits or as 10 six-bit characters, etc.). Also, TUTOR was designed before the advent of the windows-oriented graphical user interface (GUI). The microTutor language was developed in the PLATO project at UIUC to permit portions of a lesson to run in terminals that contained microcomputers, with connections to TUTOR code running on the mainframe. The microTutor dialect was also the programming language of the Cluster system developed at UIUC and licensed to TDK in Japan; the Cluster system consisted of a small group of terminals attached to a minicomputer which provided storage and compilation. The Tencore Language Authoring System is a TUTOR derivative developed by Paul Tenczar for PCs and sold by Computer Teaching Corporation. cT was a derivative of TUTOR and microTutor developed at Carnegie Mellon which allowed programs to run without change in windowed GUI environments on Windows, Mac, and Unix/Linux systems.References
External links