MAD (programming language)

Last updated

MAD
Paradigm procedural, imperative, structured
Family ALGOL
Designed by Bernard Galler, Bruce Arden, Robert M. Graham
Developer University of Michigan
First appeared1959;65 years ago (1959)
Typing discipline Static, strong
Scope Lexical
OS UMES, MTS, CTSS, others
Major implementations
IBM 704, 7090, S/360, S/370; UNIVAC 1108; Philco 210-211
Dialects
MAD, MAD/I, GOM
Influenced by
IAL, ALGOL 58

MAD (Michigan Algorithm Decoder) is a programming language and compiler for the IBM 704 and later the IBM 709, IBM 7090, IBM 7040, UNIVAC 1107, UNIVAC 1108, Philco 210-211, and eventually IBM System/370 mainframe computers. Developed in 1959 at the University of Michigan by Bernard Galler, Bruce Arden and Robert M. Graham, MAD is a variant of the ALGOL language. It was widely used to teach programming at colleges and universities during the 1960s and played a minor role in the development of Compatible Time-Sharing System (CTSS), Multics, and the Michigan Terminal System computer operating systems. [1] The original version of the chatbot ELIZA was written in MAD-SLIP. [2]

Contents

The archives at the Bentley Historical Library of the University of Michigan contain reference materials on the development of MAD and MAD/I, including three linear feet of printouts with hand-written notations and original printed manuals. [3] [4] [5] [6]

MAD, MAD/I, and GOM

Three MAD compilers exist:

  1. Original MAD, the compiler developed in 1959 at the University of Michigan for the IBM 704 and later the IBM 709 and IBM 7090 mainframe computers running the University of Michigan Executive System (UMES) and the Compatible Time-Sharing System (CTSS) operating systems. [7] [8] In the mid-1960s MAD was ported at the University of Maryland to the UNIVAC 1108. [9] Versions of MAD were also available for the Philco 210-211 and UNIVAC 1107. [9]
  2. MAD/I, an "extended" version of MAD for the IBM System/360 series of computers running under the Michigan Terminal System (MTS). Work on the new compiler started in 1965 as part of the ARPA sponsored CONCOMP project at the University of Michigan. As work progressed it gradually became clear that MAD/I was a new language independent of the original 7090 version of MAD. [10]
  3. GOM (Good Old MAD), a reimplementation of the original 7090 MAD for the IBM System/370 series of mainframe computers running the Michigan Terminal System (MTS). GOM was created in the early 1980s by Don Boettner at the University of Michigan Computing Center. [11] [12]

History

While MAD was motivated by ALGOL 58, it does not resemble ALGOL 58 in any significant way. [13] [14]

Programs written in MAD included MAIL, [15] RUNOFF, [16] one of the first text processing systems, and several other utilities all under Compatible Time-Sharing System (CTSS). [17] Work was done on a design for a MAD compiler for Multics, but it was never implemented. [18]

The following is an interesting quote from An Interview with Brian Kernighan [19] when he was asked "What hooked you on programming?":

I think that the most fun I had programming was a summer job at Project MAC at MIT in the summer of 1966, where I worked on a program that created a job tape for the brand new GE 645 in the earliest days of Multics. I was writing in MAD, which was much easier and more pleasant than the FORTRAN and COBOL that I had written earlier, and I was using CTSS, the first time-sharing system, which was infinitely easier and more pleasant than punch cards.

MAD was quite fast compared to some of the other compilers of its day. Because a number of people were interested in using the FORTRAN language and yet wanted to obtain the speed of the MAD compiler, a system called MADTRAN (written in MAD) was developed. MADTRAN was simply a translator from FORTRAN to MAD, which then produced machine code. MADTRAN was distributed through SHARE. [13]

MAD/I has a syntactic structure similar to ALGOL 60 together with important features from the original MAD and from PL/I. [10] MAD/I was designed as an extensible language. It was available for use under MTS and provided many new ideas which made their way into other languages, but MAD/I compilations were slow and MAD/I never extended itself into widespread use when compared to the original 7090 MAD. [12]

GOM is essentially the 7090 MAD language modified and extended for the 360/370 architecture with some judicious tailoring to better fit current programming practices and problems. [12] The MTS Message System was written in GOM.

MAD, Mad magazine, and Alfred E. Neuman

Line printer output following a MAD compiler error on an IBM 704 computer at the University of Michigan, c. 1960 MAD-alfie-1960.jpg
Line printer output following a MAD compiler error on an IBM 704 computer at the University of Michigan, c. 1960

In a pre-release version of the original MAD, as a reference to MAD's namesake, Mad magazine, when a program contained too many compile time errors the compiler would print a full-page picture of Alfred E. Neuman using ASCII art. The caption read, "See this man about your program--He might want to publish it. He never worries--but from the looks of your program, you should." [9] This feature was not included in the final official version. [20] However, it was included in the production version for the IBM 7040.

And Bernie Galler remembers:

By the time we designed the language that we thought would be worth doing and for which we could do a compiler, we couldn't call it Algol anymore; it really was different. That's when we adopted the name MAD, for the Michigan Algorithm Decoder. We had some funny interaction with the Mad magazine people, when we asked for permission to use the name MAD. In a very funny letter, they told us that they would take us to court and everything else, but ended the threat with a P.S. at the bottom - "Sure, go ahead." Unfortunately, that letter is lost. [21]

"Hello, world" example

The "hello, world" example program prints the string "Hello, world" to a terminal or screen display.

PRINT FORMAT HELLOW VECTOR VALUES HELLOW=$13h0Hello, world*$ END OF PROGRAM

The first character of the line is treated as logical carriage control, in this example the character "0" which causes a double-spaced line to be printed.

Alternatively, contractions can be used, and the compiler will expand them in the listing:

P'T HELLOW V'S HELLOW=$13h0Hello, world*$ E'M

Language elements

MAD and GOM, but not MAD/I, are composed of the following elements: [8] [12] [13]

Input format

MAD programs are a series of statements written on punched cards, generally one statement per card, although a statement can be continued to multiple cards. Columns 1-10 contains an optional statement label, comments or remarks are flagged using the letter "R" in column 11, and columns 73-80 are unused and could contain a sequence identifier. Spaces are not significant anywhere other than within character constants. For GOM input is free form with no sequence field and lines may be up to 255 characters long; lines that start with an asterisk (*) are comments; and lines that start with a plus-sign (+) are continuation lines.

Names

Variable names, function names, and statement labels have the same form, a letter followed by zero to five letters or digits. Function names end with a period. All names can be subscripted (the name followed by parentheses, with multiple subscripts separated by commas). For GOM names may be up to 24 characters long and may include the underscore (_) character.

Few keywords in the language are reserved words since most are longer than six letters or are surrounded by periods. There is a standard set of abbreviations which can be used to replace the longer words. These consist of the first and last letters of the keywords with an apostrophe between them, such as W'R for WHENEVER and D'N for DIMENSION.

Data types

MAD uses the term "mode" for its data types. Five basic modes are supported:

The mode of a constant can be redefined by adding the character M followed by a single digit at the end of the constant, where 0 indicates floating point, 1 integer, 2 boolean, 3 function name, and 4 statement label.

For GOM six additional modes are added: CHARACTER, SHORT INTEGER, BYTE INTEGER, LONG INTEGER, POINTER, and DYNAMIC RECORD.

Alphabetic or character constants are stored as integers and written using the dollar sign as a delimiter ($ABCDEF$) with double dollar-signs used to enter a true dollar sign ($$$.56$ is 56 cents). Strings longer than six characters are represented using arrays.

Arrays and matrices

List of operators, statements, and functions

Operators

Declaration statements

Variables may be implicitly or explicitly declared. By default all implicitly declared variables are assumed to be floating point. The NORMAL MODE IS statement may be used to change this default.

Executable statements

Input and output statements

Functions

Function names end with a period. Internal and external functions are supported. Internal functions are compiled as part of the program in which they are used and share declarations and variables with the main program. External functions are compiled separately and do not share declarations and variables. A one statement definition of internal functions is permitted. Recursive functions are permitted, although the function must do some of the required saving and restoring work itself.

Operator definition and redefinition

One of the most interesting features in MAD is the ability to extend the language by redefining existing operators, defining new operators, or defining new data types (modes). The definitions are made using MAD declaration statements and assembly language mnemonics included following the declaration up to the END pseudo-instruction that implement the operation.

where:

Three pre-defined packages of definitions (MATRIX, DOUBLE PRECISION, and COMPLEX) are available for inclusion in MAD source programs using the INCLUDE statement.

See also

Notes

  1. Alt, Franz (1967). Advances in Computers. Academic Press. p. 143. ISBN   0-12-012104-2.
  2. Shrager, Jeff. "Joseph Weizenbaum's Original ELIZA".
  3. Technical Memos, University of Michigan Computing Center publications, 1965-1999
  4. Technical Reports, University of Michigan Computing Center publications, 1965-1999
  5. Topical File 1960-1986, University of Michigan Computing Center records, 1952-1996
  6. MAD (Michigan Algorithm Decoder) 1960-1979, University of Michigan Computing Center records, 1952-1996
  7. A User's Reference Manual For The Michigan Algorithm Decoder (MAD) For the IBM 7090, Digital Computer Laboratory, Graduate College, University of Illinois, 1962, 221 pages
  8. 1 2 The Michigan Algorithm Decoder (The MAD Manual), Bruce W. Arden, Revised Edition 1966
  9. 1 2 3 George Gray (June 2002). "UNIVAC and ALGOL". Unisys History Newsletter. 6 (2). Archived from the original on June 29, 2017.
  10. 1 2 The MAD/I Manual, Bolas, Springer, and Srodawa, CONCOMP Technical Report 32, 1970, University of Michigan, Ann Arbor, 194 pages
  11. MTS Volume 2: Public File Descriptions, University of Michigan Computing Center, 1990, p. 14
  12. 1 2 3 4 GOM Manual, Don Boettner, University of Michigan Computing Center, Ann Arbor, June 1989
  13. 1 2 3 Computer Languages - Principles and History
  14. In August 2010 when asked about Jean's Sammet's statement that "MAD does not resemble ALGOL 58 in any significant way", Bruce Arden wrote: "Regarding Jean Sammet, she may have conflated the two versions of IAL (58 and 60). Unlike the later version, the 58 version said nothing about what words (or language) should be used to identify conditional and transfer statements, which led for parsing reasons to words like WHENEVER. Also there were some additional features in MAD that went beyond the 58 specs."
  15. Documentation and Source for Early Electronic Mail and Messaging, Tom Van Vleck
  16. "... Doug McIlroy and Bob Morris wrote Multics runoff in BCPL based on Jerry Saltzer's MAD version of RUNOFF for CTSS.", "Multics Software Features: Section 1.7.7", Multicans Web site. Retrieved November 10, 2018.
  17. Compatible Time-Sharing System (1961-1973): Fiftieth Anniversary Commemorative Overview, David Walden and Tom Van Vleck (Eds), 2011, IEEE Computer Society. Retrieved November 10, 2018.
  18. "Glossary of Multics acronyms and terms", Tom Van Vleck, Multicans Web site.
  19. Noren, Allen (April 10, 2009). "An Interview with Brian Kernighan: Breeding Little Languages". O'Reilly Community. Archived from the original on June 30, 2017. Retrieved July 28, 2023.
  20. Shneiderman, Ben; Plaisant, Catherine (May 7, 2004). Designing the user interface (4th ed.). Addison Wesley. ISBN   978-0-321-19786-3.
  21. Galler, Bernard A.; Galler, Enid H. (January 2001). "A Career Interview with Bernie Galler". IEEE Annals of the History of Computing . 23 (1): 22–33. doi:10.1109/85.910847. ISSN   1058-6180.

Related Research Articles

<span class="mw-page-title-main">ALGOL</span> Family of programming languages

ALGOL is a family of imperative computer programming languages originally developed in 1958. ALGOL heavily influenced many other languages and was the standard method for algorithm description used by the Association for Computing Machinery (ACM) in textbooks and academic sources for more than thirty years.

PL/I is a procedural, imperative computer programming language initially developed by IBM. It is designed for scientific, engineering, business and system programming. It has been in continuous use by academic, commercial and industrial organizations since it was introduced in the 1960s.

Pascal is an imperative and procedural programming language, designed by Niklaus Wirth as a small, efficient language intended to encourage good programming practices using structured programming and data structuring. It is named after French mathematician, philosopher and physicist Blaise Pascal.

<span class="mw-page-title-main">Simula</span> Early object-oriented programming language

Simula is the name of two simulation programming languages, Simula I and Simula 67, developed in the 1960s at the Norwegian Computing Center in Oslo, by Ole-Johan Dahl and Kristen Nygaard. Syntactically, it is an approximate superset of ALGOL 60, and was also influenced by the design of Simscript.

<span class="mw-page-title-main">GE 645</span> 1960s Mainframe Computer

The GE 645 mainframe computer was a development of the GE 635 for use in the Multics project. This was the first computer that implemented a configurable hardware protected memory system. It was designed to satisfy the requirements of Project MAC to develop a platform that would host their proposed next generation time-sharing operating system (Multics) and to meet the requirements of a theorized computer utility. The system was the first truly symmetric multiprocessing machine to use virtual memory, it was also among the first machines to implement what is now known as a translation lookaside buffer, the foundational patent for which was granted to John Couleur and Edward Glaser.

<span class="mw-page-title-main">IBM 7090</span> Mainframe computer

The IBM 7090 is a second-generation transistorized version of the earlier IBM 709 vacuum tube mainframe computer that was designed for "large-scale scientific and technological applications". The 7090 is the fourth member of the IBM 700/7000 series scientific computers. The first 7090 installation was in December 1959. In 1960, a typical system sold for $2.9 million or could be rented for $63,500 a month.

TYPSET is an early document editor that was used with the 1964-released RUNOFF program, one of the earliest text formatting programs to see significant use.

ALGOL W is a programming language. It is based on a proposal for ALGOL X by Niklaus Wirth and Tony Hoare as a successor to ALGOL 60. ALGOL W is a relatively simple upgrade of the original ALGOL 60, adding string, bitstring, complex number and reference to record data types and call-by-result passing of parameters, introducing the while statement, replacing switch with the case statement, and generally tightening up the language.

This article presents a timeline of events in the history of computer operating systems from 1951 to the current day. For a narrative explaining the overall developments, see the History of operating systems.

<span class="mw-page-title-main">Compatible Time-Sharing System</span> Computer operating system

The Compatible Time-Sharing System (CTSS) was the first general purpose time-sharing operating system. Compatible Time Sharing referred to time sharing which was compatible with batch processing; it could offer both time sharing and batch processing concurrently.

The University of Michigan Executive System, or UMES, a batch operating system developed at the University of Michigan in 1958, was widely used at many universities. Based on the General Motors Executive System for the IBM 701, UMES was revised to work on the mainframe computers in use at the University of Michigan during this time and to work better for the small student jobs that were expected to be the primary work load at the university.

ALGOL 60 is a member of the ALGOL family of computer programming languages. It followed on from ALGOL 58 which had introduced code blocks and the begin and end pairs for delimiting them, representing a key advance in the rise of structured programming. ALGOL 60 was one of the first languages implementing function definitions. ALGOL 60 function definitions could be nested within one another, with lexical scope. It gave rise to many other languages, including CPL, PL/I, Simula, BCPL, B, Pascal, and C. Practically every computer of the era had a systems programming language based on ALGOL 60 concepts.

<span class="mw-page-title-main">ALGOL 68</span> Programming language

ALGOL 68 is an imperative programming language that was conceived as a successor to the ALGOL 60 programming language, designed with the goal of a much wider scope of application and more rigorously defined syntax and semantics.

ALGOL 58, originally named IAL, is one of the family of ALGOL computer programming languages. It was an early compromise design soon superseded by ALGOL 60. According to John Backus

The Zurich ACM-GAMM Conference had two principal motives in proposing the IAL: (a) To provide a means of communicating numerical methods and other procedures between people, and (b) To provide a means of realizing a stated process on a variety of machines...

The Navy Electronics Laboratory International ALGOL Compiler (NELIAC) is a dialect and compiler implementation of the programming language ALGOL 58, developed by the Navy Electronics Laboratory (NEL) in 1958.

Robert M. Graham was a cybersecurity researcher computer scientist and Professor Emeritus of Computer Science at the University of Massachusetts Amherst. He was born to a Scottish emigrant.

PL360 is a system programming language designed by Niklaus Wirth and written by Wirth, Joseph W. Wells Jr., and Edwin Satterthwaite Jr. for the IBM System/360 computer at Stanford University. A description of PL360 was published in early 1968, although the implementation was probably completed before Wirth left Stanford in 1967.

<span class="mw-page-title-main">History of compiler construction</span>

In computing, a compiler is a computer program that transforms source code written in a programming language or computer language, into another computer language. The most common reason for transforming source code is to create an executable program.

<span class="mw-page-title-main">Bruce Arden</span> American computer scientist (1927–2021)

Bruce Wesley Arden was an American computer scientist.

References