# XPL

> dialect of the PL/I programming language, designed to be used in writing compilers

**Wikidata**: [Q4021505](https://www.wikidata.org/wiki/Q4021505)  
**Wikipedia**: [English](https://en.wikipedia.org/wiki/XPL)  
**Source**: https://4ort.xyz/entity/xpl

## Summary
XPL is a dialect of the PL/I programming language created in 1967 and optimized for writing compilers. It strips PL/I down to a compact, procedural core so that compiler writers can describe a new language’s grammar, parse source code, and emit machine code without wrestling with extraneous features.

## Key Facts
- Inception: 1967 (Wikidata reference Q328)
- Based on: PL/I; retains only the subset needed for compiler construction
- Programming paradigms: procedural, structured
- Freebase ID: /m/03n9f5
- Wikidata sitelinks: 3 (English, French, Cantonese Wikipedia editions)
- Instance of: programming language
- Influenced by: PL/I (same reference Q328)

## FAQs
### Q: What made XPL different from full PL/I?
A: XPL omits PL/I’s I/O, multitasking, and extensive data-type libraries, leaving a small, fast subset that fits in 32 KB of memory—ideal for bootstrapping compilers on 1960s minicomputers.

### Q: Is XPL still used today?
A: No. Modern compiler tool-chains (LLVM, ANTLR, etc.) have superseded it, but XPL remains a textbook example of a self-hosting, retargetable compiler.

### Q: How portable was an XPL compiler?
A: The entire compiler is written in its own language, so once the small kernel is moved to a new machine the whole system can recompile itself—an early example of a self-hosting compiler.

## Why It Matters
In the late 1960s most compilers were hand-coded in assembly and tied to one processor. XPL showed that a high-level, machine-independent language could describe not only applications but also the translators that turn source into binary. By shrinking PL/I to a compiler-writer’s toolkit, XPL let universities and small teams produce optimizing compilers for new architectures in weeks instead of years. Its success popularized the ideas of bootstrapping (a compiler written in its own language) and portability through intermediate code, concepts that echo in today’s LLVM and GCC. For historians, XPL is a concise demonstration that even a minimalist language can be self-sustaining and retargetable.

## Notable For
- One of the first widely documented self-hosting, retargetable compiler generators
- Achieved full compiler functionality in under 16 K lines of XPL source
- Demonstrated that a large general-purpose language (PL/I) could be pruned to a special-purpose domain tool
- Served as the reference implementation for the “XPL Compiler Generator System” distributed by SIGPLAN in 1970

## Body
### Origin and Motivation
XPL was designed at the University of California, Santa Cruz, in 1967 by a team that needed a quick way to experiment with new programming languages on IBM System/360 hardware. Rather than write each new compiler from scratch in assembly, they subsetted PL/I into a lean notation that could describe lexical scanners, parsers, and code generators.

### Language Design
The dialect keeps PL/I syntax but removes bit-level data types, multitasking, and extensive I/O. Only integers, fixed-length strings, and arrays remain. Control structures are strictly procedural: IF-THEN-ELSE, DO-WHILE, and GOTO. This discipline guarantees that every XPL program can be translated into a small, efficient object module.

### Implementation Strategy
The compiler is structured in three passes: lexical analysis, syntactic analysis with recursive descent, and code generation. Each pass is expressed as an XPL procedure, and the entire compiler is small enough to run in a 32 KB partition on OS/360. Because the source is self-contained, moving the compiler to a new machine requires only rewriting the back-end emitter for the target instruction set.

### Legacy
Although superseded by yacc/lex and later by LLVM, XPL remains a canonical teaching example of how a high-level language can bootstrap its own translator. Textbooks on compiler construction routinely cite its 1970 SIGPLAN distribution tape as the first turnkey “compiler writing compiler” available to universities.