Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
XPL
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===XCOM=== The XPL compiler, called '''XCOM''', is a one-pass compiler using a table-driven [[parser]] and simple [[code generation (compiler)|code generation]] techniques. Versions of XCOM exist for different [[Instruction set|machine architectures]], using different hand-written code generation modules for those targets. The original target was [[IBM System/360]], which is a proper subset of [[IBM System/370]], [[IBM System/390]] and [[IBM System z]]. XCOM compiles from XPL source code, but since XCOM itself is written in XPL it can compile itself β it is a ''self-compiling compiler'', not reliant on other compilers. Several famous languages have self-compiling compilers, including [[Burroughs B5000]] Algol, PL/I, [[C (programming language)|C]], [[LISP]], and [[Java (programming language)|Java]]. Creating such compilers is a chicken-and-egg conundrum. The language is first implemented by a temporary compiler written in some other language, or even by an interpreter (often an interpreter for an intermediate code, as [[BCPL]] can do with [[intcode]] or [[O-code]]). XCOM began as an Algol program running on Burroughs machines, translating XPL source code into System/360 machine code. The XPL team manually turned its Algol source code into XPL source code. That XPL version of XCOM was then compiled on Burroughs, creating a self-compiling XCOM for System/360 machines. The Algol version was then thrown away, and all further improvements happened in the XPL version only. This is called [[bootstrapping (compilers)|bootstrapping]] the compiler. The authors of XPL invented the [[tombstone diagram]] or T-diagram to document the bootstrapping process. [[Retargeting]] the compiler for a new machine architecture is a similar exercise, except only the code generation modules need to be changed. XCOM is a one-pass compiler (but with an emitted code fix-up process for forward branches, loops and other defined situations). It emits [[machine code]] for each statement as each grammar rule within a statement is recognized, rather than waiting until it has parsed the entire procedure or entire program. There are no parse trees or other required intermediate program forms, and no loop-wide or procedure-wide optimizations. XCOM does, however, perform [[peephole optimization]]. The code generation response to each grammar rule is attached to that rule. This immediate approach can result in inefficient code and inefficient use of machine registers. Such are offset by the efficiency of implementation, namely, the use of dynamic strings mentioned earlier: in processing text during compilation, substring operations are frequently performed. These are as fast as an assignment to an integer; the actual substring is not moved. In short, it is quick, easy to teach in a short course, fits into modest-sized memories, and is easy to change for different languages or different target machines.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)