HOME

TheInfoList



OR:

CAL, short for Conversational Algebraic Language, was a
programming language A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language. The description of a programming ...
and
system A system is a group of interacting or interrelated elements that act according to a set of rules to form a unified whole. A system, surrounded and influenced by its environment, is described by its boundaries, structure and purpose and express ...
designed and developed by
Butler Lampson Butler W. Lampson, ForMemRS, (born December 23, 1943) is an American computer scientist best known for his contributions to the development and implementation of distributed personal computing. Education and early life After graduating from t ...
at Berkeley in 1967 for the SDS 940
mainframe computer A mainframe computer, informally called a mainframe or big iron, is a computer used primarily by large organizations for critical applications like bulk data processing for tasks such as censuses, industry and consumer statistics, enterprise ...
. CAL is a version of the seminal
JOSS Joss may refer to: * Joss (name), including a list of people with the name * JOSS, a time-sharing programming language * Joss (Chinese statue), a religious object * Joss JP1, an Australian-built supercar * Joss paper, a type of burnt offering * ...
language with a number of cleanups and new features to take advantage of the SDS platform. The Berkeley SDS was used for the development of the Tymshare commercial
time-sharing In computing, time-sharing is the sharing of a computing resource among many users at the same time by means of multiprogramming and multi-tasking.DEC Timesharing (1965), by Peter Clark, The DEC Professional, Volume 1, Number 1 Its emergence ...
platform and an improved version of CAL was offered as a programming environment to its customers in 1969. Although CAL saw "almost no use", it had a lasting impact by influencing the design of Tymshare SUPER BASIC which copied a number of its features. Some of those features, in turn, appeared in
BASIC-PLUS BASIC-PLUS is an extended dialect of the BASIC programming language that was developed by Digital Equipment Corporation (DEC) for use on its RSTS/E time-sharing operating system for the PDP-11 series of 16-bit minicomputers in the early 1970s thr ...
on the
PDP-11 The PDP-11 is a series of 16-bit minicomputers sold by Digital Equipment Corporation (DEC) from 1970 into the 1990s, one of a set of products in the Programmed Data Processor (PDP) series. In total, around 600,000 PDP-11s of all models were sol ...
, which is the direct ancestor of
Microsoft BASIC Microsoft BASIC is the foundation software product of the Microsoft company and evolved into a line of BASIC interpreters and compiler(s) adapted for many different microcomputers. It first appeared in 1975 as Altair BASIC, which was the first ...
..


Description


Basic concepts

JOSS had been designed to be used by non-programmers in the
US Air Force The United States Air Force (USAF) is the air service branch of the United States Armed Forces, and is one of the eight uniformed services of the United States. Originally created on 1 August 1907, as a part of the United States Army Sig ...
and within
Rand Corporation The RAND Corporation (from the phrase "research and development") is an American nonprofit global policy think tank created in 1948 by Douglas Aircraft Company to offer research and analysis to the United States Armed Forces. It is finance ...
, and to aid with that, Rand designed custom
computer terminal A computer terminal is an electronic or electromechanical hardware device that can be used for entering data into, and transcribing data from, a computer or a computing system. The teletype was an example of an early-day hard-copy terminal and ...
s that were easier to set up and use. These terminals, based on the
IBM Selectric The IBM Selectric typewriter was a highly successful line of electric typewriters introduced by IBM on 31 July 1961. Instead of the "basket" of individual typebars that swung up to strike the ribbon and page in a typical typewriter of the peri ...
typewriter, also included a custom
character set Character encoding is the process of assigning numbers to graphical characters, especially the written characters of human language, allowing them to be stored, transmitted, and transformed using digital computers. The numerical values tha ...
that implemented common mathematical symbols like and . To a large degree, CAL was a version of JOSS that replaced these sorts of customizations with more common solutions like and so they could run on common terminals. The other noticeable differences were that CAL was all upper-case, as opposed to sentence casing in JOSS, and it did not require a period at the end of the line. The commands were otherwise almost identical and the overall structure and syntax the same. As with JOSS, CAL had an interactive
user interface In the industrial design field of human–computer interaction, a user interface (UI) is the space where interactions between humans and machines occur. The goal of this interaction is to allow effective operation and control of the machine f ...
that allowed the user to type in statements in "direct mode" or programs to be run in "indirect mode". In BASIC, the former is more commonly referred to as "immediate mode". Both CAL and JOSS used a two-part
line number In computing, a line number is a method used to specify a particular sequence of characters in a text file. The most common method of assigning numbers to lines is to assign every line a unique number, starting at 1 for the first line, and increme ...
, known as the part and step, separated by a period, for instance, for part 1 step 100. Parts were generally used to group related statements into subroutines. In CAL, the part number could be between 0 and 999999, and the step from 0 to 99999. There were two main versions of CAL, released in 1967 and 1969. The following description will be based primarily on the former version unless otherwise noted.


Jumps and subroutines

As in JOSS, CAL supported the command to branch to a provided part or step, as in or , and for subroutine calls, as in to perform the entire part, or to run that single step and then return. The later syntax was useful when there were many small subroutines as they could be implemented on a single line without an associated or similar concept.


Conditional branching and assignment

One of the more notable syntactic features of JOSS was the concept of "statement modifiers" which controlled the operation of other statements. JOSS used this for conditional branching. In most languages, one would write something to the effect of "if this expression is true, then do this...". In JOSS, this order was reversed, and such statements took the form "do this if this is true", for instance, . CAL added some
syntactic sugar In computer science, syntactic sugar is syntax within a programming language that is designed to make things easier to read or to express. It makes the language "sweeter" for human use: things can be expressed more clearly, more concisely, or in an ...
to this basic concept by adding the new modifier , which, depending on context, led to more obvious code; . In JOSS, to assign the value 5 to a variable A if the value of B was larger than 10, and 0 otherwise, the code would be: Set A=5 if B>10. Set A=0 if B<=10. CAL also supported conditional expressions: A=IF B>10 THEN 5 ELSE 0 A similar modification was the statement, used to set variables as part of an if or for. It was similar in concept to the if/then/else structure, but could have any number of items. For instance,.


Loops

Looping in JOSS was also controlled by a modifier, the . This used somewhat obscure syntax from FORTRAN; runs a loop from 1 to 10 stepping by 2, so it would print 1,3,5,7,9. One could also supply explicit values, , or mix the two, CAL improved on JOSS' syntax by introducing the and keywords, so the equivalent code in CAL would be . In JOSS, the parenthesis around the step value was the separator for the two limits, so it could not be made optional. By separating out the limits became explicit and the was made optional as assumed to be 1; . As with JOSS, explicit values and ranges could be used; . CAL further modified the for loop by adding conditional exits, using and . For instance, or .


User-defined functions

JOSS allowed the user to define functions using the statement. The syntax allowed local variables to be named in the function signature; Programs could then call these functions as if they were built-in, CAL changed to , which is much more obvious, and made a more minor change the parameters were passed in using braces instead of parenthesis, so the equivalent definition would be and called in the same way, . A more important change to CAL's functions was the ability to call subroutines from the definitions using , as in . This left the issue of assigning the resulting calculated value back to the function, which was addressed with the introduction of the statement at the end of the part, where Z is the final value to be returned.


Other changes

CAL included the mathematical functions of JOSS but added a number of new ones including , , , and . It added a new operator as well, , which returned the remainder of a division of its two operands.


Direct mode

CAL added a small number of direct mode commands and associated statements. , when encountered in a program, printed a message "PAUSED AT STEP 1.1" and then returned to direct mode. This was similar to the command in BASIC. This allowed the user to type in values and the continue execution with . While in direct mode, the user could by a single line at a time to trace the execution of the program.


Improvements in CAL 1969

One minor change in the 1969 version was the elimination of the command for variable assignment. This had been optional in direct mode in JOSS but was required in program statements, and the 1967 version of CAL had followed this rule. The 1969 version made it optional in both cases.


Footnotes


References


Citations


Bibliography

* * {{cite book , first=Butler , last=Lampson , url=http://bitsavers.informatik.uni-stuttgart.de/pdf/sds/9xx/940/901114A_940_CAL_RefMan_Jun67.pdf , title=CAL Reference Manual for SDS 940 Time-Sharing Computer Systems , publisher=Scientific Data Systems , date=June 1967 , ref=CITEREFManual1967 JOSS programming language family Tymshare software