TMG (language)
{{Infobox programming language
| name = TMG
| paradigm =
| year = {{start date and age|1963}}{{Cite web|url=http://www.chilton-computing.org.uk/acl/applications/cc/p007.htm#s3p3|title=Early Translator Writing Systems - Brooker-Morris Compiler Compiler 1966|access-date=2020-04-12|publisher=Atlas Computer Laboratory|quote=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].|url-status=live|archive-url=https://web.archive.org/web/20200131192031/http://www.chilton-computing.org.uk/acl/applications/cc/p007.htm|archive-date=31 January 2020}}
| designer = Robert M. McClure
| developer = Robert M. McClure
| latest_release_version =
| latest_release_date =
| latest_test_version =
| latest_test_date =
| turing-complete =
| typing =
| implementations =
| dialects = Unix dialect (by Douglas McIlroy)
| influenced_by =
| influenced = TROL (by Donald Knuth){{cite book |first=Donald |last=Knuth |author-link=Donald Knuth |chapter=The Genesis of Attribute Grammars |chapter-url=https://www.dcs.warwick.ac.uk/~sk/cs325/gag.pdf |location=New York |title=Proceedings of the International Conference on Attribute Grammars and Their Applications (Paris, France) |series=Lecture Notes in Computer Science |editor1=P. Deransart |editor2=M. Jourdan |publisher=Springer-Verlag |year=1990 |volume=461 |pages=1–12 |doi=10.1007/3-540-53101-7_1 |isbn=978-3-540-53101-2 }}
| operating_system =
| license =
| website =
| file_ext =
}}
{{Infobox programming language
| name = Unix TMG
| screenshot = Brainfuck to C translator in Unix TMG.png
| screenshot size = 225px
| screenshot caption = TMG program with highlighted syntax
| paradigm =
| year = {{start date and age|1969}}
| designer =
| developer = Douglas McIlroy
| latest_release_version =
| latest_release_date =
| latest_test_version =
| latest_test_date =
| turing-complete = yes
| typing =
| implementations =
| dialects = PDP-7 version, PDP-11 version
| influenced_by = ALGOL 68,{{cite conference |last=Ritchie |first=Dennis M. |author-link=Dennis Ritchie |date=April 1993 |title=The Development of the C Language |publisher=Association for Computing Machinery, Inc. |url=https://www.bell-labs.com/usr/dmr/www/chist.pdf }} B, PL/I, SNOBOL{{cite tech report |last=McIlroy |first=M. D. |author-link=Douglas McIlroy |date=September 13, 1972 |title=A Manual for the Tmg Compiler-writing Language |publisher=Bell Laboratories |location=Murray Hill, New Jersey |url=https://amakukha.github.io/tmg/TMG_Manual_McIlroy_1972.html |access-date=31 January 2020}}
| operating_system =
| license =
| website =
| file_ext = .t
}}
In computing TMG (TransMoGrifier) is a recursive descent compiler-compiler{{Cite web|url=https://www.cs.dartmouth.edu/~doug/|title=M. Douglas McIlroy|publisher=Dartmouth College|access-date=2020-04-12|url-status=live|archive-url=https://web.archive.org/web/20200201043232/https://www.cs.dartmouth.edu/~doug/ |archive-date=1 February 2020|quote=Some things I have worked on: Languages and compilers: macros, Lisp, PL/I, TMG (a compiler-compiler), regular expressions; influenced Snobol, Altran, C++ ...}} developed by Robert M. McClure and presented in 1965.{{cite book |first=R.M. |last=McClure |chapter=TMG—A Syntax-Directed Compiler |chapter-url=https://dl.acm.org/citation.cfm?id=806050&preflayout=flat |editor=L. Winner |title= Proceedings of the 1965 20th national conference (ACM '65) |publisher=ACM |year=1965 |doi=10.1145/800197.806050 |pages=262–274 |isbn=978-1-4503-7495-8 |s2cid=44606611 }}{{cite tech report |first1=M. D. |last1=McIlroy |author-link1=Doug McIlroy |year=1987 |url=http://www.cs.dartmouth.edu/~doug/reader.pdf |title=A Research UNIX Reader: Annotated Excerpts from the Programmer's Manual, 1971-1986|series=CSTR |number=139 |institution=Bell Labs |format=PDF|url-status=live|archive-url=https://web.archive.org/web/20200411235037/https://www.cs.dartmouth.edu/~doug/reader.pdf|archive-date=11 April 2020|quote=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, and join. He also collected dictionaries and made tools to use them: look (v7, after a model by Ossanna), dict (v8), and spell (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 new tmg, ... and Ritchie’s first C, }} TMG ran on systems including OS/360 and early Unix.{{Cite web|url=https://www.multicians.org/tmg.html|title=TMG|website=www.multicians.org|access-date=2020-04-12|url-status=live|archive-url=https://web.archive.org/web/20200102213003/https://www.multicians.org/tmg.html|archive-date=2 January 2020|quote=... 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 the B language on his PDP-7 in 1970. B was the immediate ancestor of C. }} It was used to build EPL, an early version of PL/I.
Douglas McIlroy ported TMG to an early version of Unix. According to Ken Thompson, McIlroy wrote TMG in TMG on a piece of paper and "decided to give his piece of paper his piece of paper," hand-compiling assembly language that he entered and assembled on Thompson's Unix system running on PDP-7.{{cite web|title=VCF East 2019 -- Brian Kernighan interviews Ken Thompson| author=Ken Thompson| website=YouTube| date=6 May 2019| url=https://www.youtube.com/watch?v=EY6q5dv_B-o&t=2330| access-date=2019-10-28}} Thompson used TMG in 1970 as a tool to offer Fortran, but due to memory limitations of PDP-7 ended up creating the B programming language which was much influenced by BCPL.{{cite web|archive-url=https://web.archive.org/web/20140908034458/http://cm.bell-labs.com/cm/cs/who/dmr/hist.html|archive-date=8 September 2014|url-status=dead|url=http://cm.bell-labs.com/cm/cs/who/dmr/hist.html|access-date=9 April 2004|title=The Evolution of the Unix Time-sharing System*|last=Ritchie|first=Dennis M.|author-link=Dennis M. Ritchie|quote=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.}}
The recursive descent algorithm of TMG was studied formally by Alexander Birman and Jeffrey Ullman. The formal description of the algorithms was named TMG recognition scheme (or simply TS).{{cite journal |title=Parsing algorithms with backtrack |journal=Information and Control |last1=Birman |first1=Alexander |last2=Ullman |first2=Jeffrey D |author-link2=Jeffrey Ullman |pages=1–34 |volume=23 |publisher=Elsevier B.V |number=1 |year=1973 |doi=10.1016/S0019-9958(73)90851-6 |issn=0019-9958 }}
See also
References
{{reflist|colwidth=30em}}
External links
- {{cite encyclopedia |title=TMG – Compiler writing language |encyclopedia=HOPL: Online Historical Encyclopaedia of Programming Languages |url=http://hopl.murdoch.edu.au/showlanguage.prx?exp=242 |archive-url=https://web.archive.org/web/20070921161049/http://hopl.murdoch.edu.au/showlanguage.prx?exp=242 |archive-date=September 21, 2007}}
- {{GitHub|amakukha/tmg|Port of Unix TMG}}
Category:Low-level programming languages
{{Prog-lang-stub}}