| TMG | |
|---|---|
| Designed by | Robert M. McClure |
| Developer | Robert M. McClure |
| First appeared | 1963; 62 years ago (1963)[1] |
| Dialects | |
| Unix dialect (byDouglas McIlroy) | |
| Influenced | |
| TROL (byDonald Knuth)[2] | |
| Unix TMG | |
|---|---|
TMG program with highlighted syntax | |
| Developer | Douglas McIlroy |
| First appeared | 1969; 56 years ago (1969) |
| Filename extensions | .t |
| Dialects | |
| PDP-7 version,PDP-11 version | |
| Influenced by | |
| ALGOL 68,[3]B,PL/I,SNOBOL[4] | |
| Influenced | |
| B,Yacc | |
In computing,TMG (Transmogrifier) is arecursive descentcompiler-compiler[5] developed by Robert M. McClure and presented in 1965.[6][7][8]
TMG ran on systems includingOS/360 and earlyUnix.[9] It was used to build EPL, an early version ofPL/I.[9]
Douglas McIlroy ported TMG to an early version of Unix. According toKen Thompson, McIlroy wrote TMG in TMG on a piece of paper and "decided to give his piece of paper his piece of paper," hand-compilingassembly language that he entered and assembled on Thompson'sUnix system running onPDP-7.[10] Thompson used TMG in 1970 as a tool to offerFortran, but due to memory limitations of PDP-7 ended up creating theB programming language which was much influenced byBCPL.[6]
The recursive descent algorithm of TMG was studied formally by Alexander Birman andJeffrey Ullman. The formal description of the algorithms was namedTMG recognition scheme (or simplyTS).[11]
TMG, ... comes later but appears to have not been influenced by the earlier systems [Alick Glennie's 1960 Syntax Machine, Ned Irons 1960 PSYCO compiler, or Brooker and Morris's 1960 Compiler-Compiler].
Some things I have worked on: Languages and compilers: macros, Lisp, PL/I, TMG (a compiler-compiler), regular expressions; influenced Snobol, Altran, C++ ...
Every program for the original PDP-7 Unix system was written in assembly language, and bare assembly language it was—for example, there were no macros. Moreover, there was no loader or link-editor, so every program had to be complete in itself. The first interesting language to appear was a version of McClure's TMG that was implemented by McIlroy. Soon after TMG became available, Thompson decided that we could not pretend to offer a real computing service without Fortran, so he sat down to write a Fortran in TMG. As I recall, the intent to handle Fortran lasted about a week. What he produced instead was a definition of and a compiler for the new language B.
Doug (M. Douglas) McIlroy exercised the right of a department head to muscle in on the original two-user PDP-7 system. Later he contributed an eclectic bag of utilities:tmg for compiler writing, speak for reading text aloud,diff, andjoin. He also collected dictionaries and made tools to use them:look (v7, after a model by Ossanna),dict (v8), andspell (v7). ... On the tiny PDP-7 the assembler was supplemented by tmg, Doug McIlroy's version of Bob McClure's compiler-compiler. ... V2 saw a burst of languages: a newtmg, ... and Ritchie's firstC,
... TMG that runs under OS360 (sic) ... Mike Green took Bob McClure's 7090/7040 version and implemented the compiler-compiler on the 360; ... TMG was the compiler definition tool used by Ken Thompson to write the compiler for theB language on his PDP-7 in 1970. B was the immediate ancestor ofC.