{{language|TMG
|exec=machine
|hopl=yes
|hopl id=242
|LCT=yes
|bnf=https://amakukha.github.io/tmg/TMG_Manual_McIlroy_1972.html#s9-2
}}
[[wp:TMG (language)|'''TMG''']] (from ''transmogrifier'') is an early compiler-compiler introduced by Robert McClure in the mid-1960s. Later it was ported and further developed by Doug McIlroy of Bell Labs to work on microcomputers PDP-7 and PDP-11 under the UNIX operating system. McIlroy's dialect of TMG (the '''Unix TMG''') was included into the UNIX operating system from Version 2 to Version 6. It was the first high-level programming language running on UNIX.


TMG was used to implement:
* EPL (Early [[:Category:PL/I|PL/I]]) on Multics operating system
* [[:Category:B|B programming language]] by Ken Thompson


TMG influenced:
* [[:Category:B|B]] (via Unix TMG)
* TROL (Translation-Oriented Language) of Donald Knuth
* YACC

== Running ==
There are two ways to run Unix TMG on modern computers:
* by using a PDP-11 emulator with the original Unix V6 image
* by running a modern [https://github.com/amakukha/tmg port of Unix TMG]

== References ==
* McIlroy, M. D. [https://amakukha.github.io/tmg/TMG_Manual_McIlroy_1972.html ''A Manual for the Tmg Compiler-writing Language''] (1972) <nowiki>[</nowiki>[https://www.tuhs.org/Archive/Distributions/Research/1972_stuff/tmg.pdf scanned original]<nowiki>]</nowiki>
* [http://hopl.info/showlanguage.prx?exp=242&language=TMG ''TMG – Compiler writing language'']. HOPL: Online Historical Encyclopaedia of Programming Languages.

[[Category:Programming Languages]]