Content deleted Content added
Jerryobject (talk | contribs) WP:LINKs: updates, adds, fix-cut needless WP:PIPEs (WP:NOPIPEs). Small WP:EoS WP:TERSE WP:COPYEDITs: clarify. MOS:FIRSTABBReviations define before WP:ABBRs. Nonlead-word nonproper noun MOS:CAPS MOS:HEADings-MOS:HEADCAPS, nonacronym proper noun WP:ALLCAPS > sentence case. Plain text list > WP:CITation Template:Cite journals, parameters: add, fill. WP:NAVBOX add. |
m Open access bot: doi added to citation with #oabot. |
||
(9 intermediate revisions by 9 users not shown) | |||
Line 27:
| influenced =
}}
'''IMP''' is an early [[
Even though {{citation needed span|date=June 2020|reason=While presumably true, the actual quote deserves a specific cite amongst a plethora of similar statements|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.
A [[compiler]] for IMP existed as early as 1965 and was used to program the [[CDC 6600]] time-sharing system, which was in use at the [[Institute for Defense Analyses]] since 1967. Although the compiler is slower than comparable ones for non-extensible languages, it has been used for practical production work.
Line 41:
Basically, the syntax statement is an augmented BNF production with associated [[Semantics (computer science)|semantics]] added on the right:
<
<class> ::= syntax-part ::= semantic-part
</syntaxhighlight>
For example, to add the construct described by the following BNF:
<
<EXP> ::= INCREMENT <VBL>
</syntaxhighlight>
with the semantics that <code>INCREMENT V</code> should translate to <code>V ← V + 1</code>, the programmer would only need to insert the following ''IMP statement'':
<
<EXP> ::= INCREMENT <VBL,A> ::= "A←A+1"
</syntaxhighlight>
The semantic-part can also contain calls to ''semantic routines'', as in the following syntax statement:
<
<ATOM> ::= ABS ( <ATOM,A> ) ::= DEWOP(214B,AREG1(1,13),A)
</syntaxhighlight>
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 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>.
Line 66:
==References==
{{Reflist}}
*{{Cite journal |last=Irons |first=Edgar T. |date=January 1970 |title=Experience with an Extensible Language |journal=[[Communications of the ACM]]
*{{Cite journal |last=Bilofsky |first=Walter |date=May 1974 |title=Syntax Extension and the IMP72 Programming Language |journal=SIGPLAN Notices |volume=9 |issue=5 |pages=13–30 |publisher=[[Association for Computing Machinery]] |doi=10.1145/987413.987416 |s2cid=2170981 |via=Yale University}}
==External links==
Line 78:
[[Category:Extensible syntax programming languages]]
[[Category:Systems programming languages]]
[[Category:National Security Agency]]
|