IMP (programming language): Difference between revisions

Content deleted Content added
Danakil (talk | contribs)
No edit summary
Danakil (talk | contribs)
No edit summary
Line 1:
'''IMP''' was a [[systems (programming)|systems]] [[programming language]] developed by Irons in the late 1960's through early 1970's. Unlike most other systems programming languages, IMP was an [[:Category:Extensible syntax programming languages|extensible syntax programming language]].
'''IMP''' is a defunct family of [[programming language]]s intended primarily for [[systems programming]], although at least one IMP was extended enough to be a [[general-purpose programming language]]. Expressively, IMP is similar to [[FORTRAN II]], while syntactically it looks more like [[ALGOL (programming language)|ALGOL]], although it lacks [[block structure]], [[reserved keyword]]s, and [[datatype]]s (it does support both integer and floating-point numbers). IMP allows the programmer to embed [[machine language]] instructions into the IMP source code.
 
Even though its designer refers to the language as "being based on [[ALGOL]]", IMP excludes many ''defining'' features of that language, while supporting a very non-ALGOL-like one: syntax extensibility.
IMP is [[expression-oriented (programming)|expression-oriented]]: there is no distinction between common expressions and [[statement (programming)|statement]]s, even though sometimes an expression is only needed for its [[side effect (programming)|side effect]]s. For example, a read statement's value indicates whether and [[EOL]] (end-of-line) or an [[EOF]] (end-of-file) was encountered, although what's typically used is the expression's side effect of performing input.
 
A compiler for IMP existed as early as 1965 and was used for programming the [[CDC 6600]] time-sharing system, which was in use at the [[Institute for Defense Analysis]] since 1967. Although the compiler is slower than comparable ones for non-extensible languages, it has been used for practical production work.
IMP compilers were developed for the [[CDC-6600]], [[PDP-10]] and [[PDP-11]] computers. Important IMP versions were '''IMP65''', '''IMP70''', and '''IMP72'''. IMP was used to implement the [[EMAS]] [[operating system]].
 
IMP compilers were developed for the [[CDC-6600]], [[PDP-10]] and [[PDP-11]] computers. Important IMP versions were '''IMP65''', '''IMP70''', and '''IMP72'''. IMP was used to implement the [[EMAS]] [[operating system]].
 
IMP is unrelated to the [[Edinburgh IMP programming language]].
 
==Extensible syntax in IMP72==
Line 25 ⟶ 29:
<ATOM> ::= ABS ( <ATOM,A> ) ::= DEWOP(214B,AREG1(1,13),A)
The semantic part of this statement consists of a call on the semantic routine <code>DEWOP</code>. The arguments are the octal constant <code>214B</code>, the semantic routine call <code>AREG1(1,13)</code>, and <code>A</code>, which is the object on top of the stack at the moment this production is invoked. <code>DEWOP</code> is a semantic routine which respectively takes as its arguments a PDP-10 machine language [[opcode]], a register object, and any other object, and produces an object whose value is the result of executing the designated machine instruction using as address field the object which is its last argument. In this specific example, the opcode <code>214B</code> designates the <code>Load Magnitude</code> instruction, and thus the result of the above syntax statement will be to compile code to compute the absolute value of <code>A</code>.
 
==See also==
* [[Edinburgh IMP programming language]] (contrast)
 
==References==
* ''Experience with an Extensible Language'', Irons E.T., '''CACM''', Vol. 13, No. 1, January 1970.
* ''Syntax Extension and the IMP72 Programming Language'', Walter Bilofsky, Yale University, SIGPLAN Notices, May 1974.