FOCAL
An interactive interpreted programming language created by Richard Merrill at DEC for the PDP-8, derived from JOSS and designed to make computing accessible to non-programmers
Created by Richard Merrill
Overview
FOCAL — Formulating On-line Calculations in Algebraic Language — is an interactive interpreted programming language created by Richard Merrill at Digital Equipment Corporation (DEC) in 1968. Designed for the PDP-8 minicomputer, FOCAL was derived from the JOSS language developed at RAND Corporation but simplified to fit within the severely constrained memory of 12-bit minicomputers. It provided a conversational computing experience where users could type commands and receive immediate results, making it accessible to scientists, engineers, and students who were not professional programmers.
FOCAL had a brief but notable period of prominence in the late 1960s and early 1970s before being eclipsed by BASIC. Despite its relatively short active life on DEC hardware, the language had an unexpected second act in the Soviet Union during the 1980s, where it shipped in ROM on mass-produced personal computers.
History and Origins
From JOSS to FOCAL
FOCAL’s lineage traces directly to JOSS (JOHNNIAC Open Shop System), an interactive language developed at the RAND Corporation in the early 1960s. JOSS pioneered the concept of conversational computing — users typed commands at a terminal and received immediate feedback. Richard Merrill, working at DEC, adapted the JOSS concept for the PDP-8, stripping away features that required more memory than the PDP-8 could provide while retaining the core interactive experience.
The PDP-8 was the first commercially successful minicomputer, but its 4K words of 12-bit memory imposed severe constraints. FOCAL was engineered to operate within these limits while still providing a useful computing environment. The entire interpreter, including floating-point arithmetic routines, fit in approximately 4K words of core memory.
The BASIC Rivalry
FOCAL and BASIC were contemporaries competing for the same niche: an accessible interactive language for non-professional programmers. BASIC had been developed at Dartmouth College in 1964, a few years before FOCAL. On DEC hardware in the late 1960s, FOCAL was the preferred interactive language — it was bundled free with PDP-8 systems while BASIC was an optional extra.
However, two factors led to FOCAL’s decline. First, DEC was unwilling to license FOCAL to other computer manufacturers, while BASIC was available on machines from GE, Honeywell, HP, and others. Second, according to some accounts, FOCAL’s heritage from JOSS may have created intellectual property ambiguity — DEC could not be fully certain of the ownership, which reportedly discouraged further investment in the language. By the mid-1970s, DEC had standardized on BASIC across its product lines, and FOCAL development effectively ceased.
Design Philosophy
FOCAL was designed around two core principles: simplicity and immediacy. Every aspect of the language reflects the constraints of 12-bit minicomputers and the goal of making computing accessible to non-programmers.
DEC’s promotional materials for FOCAL-69 declared that “anyone can learn to write computer programs in a few hours” — and the language’s design supported this claim. Commands used plain English words (ASK, TYPE, SET), programs could be entered and tested one line at a time, and the system provided immediate feedback on errors.
Key Design Decisions
- Single-letter abbreviation: All commands begin with a unique letter, allowing users to type just the first letter.
Tfor TYPE,Sfor SET,Afor ASK, and so on. This saved both typing time and memory. - Two-part line numbers: Lines are numbered in a
group.lineformat (e.g.,01.10,02.30). Groups function as logical units that can be called as subroutines withDOor erased as a unit withERASE. - All floating-point: Every variable is a floating-point number. On the PDP-8, FOCAL numbers were reportedly stored as four 12-bit words (48 bits total) with 36 bits of mantissa and 12 bits of exponent, giving surprisingly high precision for the era.
- Variable naming: Variable names start with any letter except F (reserved for functions), and only the first two characters are significant.
Key Features
Commands
FOCAL’s command set was deliberately small:
| Command | Purpose |
|---|---|
| ASK | Prompt for and accept user input |
| SET | Assign values and perform calculations |
| TYPE | Display output with formatting |
| FOR | Loop iteration |
| IF | Three-way conditional branch (negative/zero/positive) |
| GOTO | Transfer control to a line |
| DO | Call a group as a subroutine |
| RETURN | Return from a subroutine call |
| ERASE | Delete lines or groups |
| WRITE | Display program listing |
| COMMENT | Program documentation |
| QUIT | Exit the program |
Built-in Functions
FOCAL provided mathematical functions prefixed with F:
- Trigonometric: FSIN, FCOS, FATN (arctangent)
- Exponential/Logarithmic: FEXP, FLOG
- Utility: FSQT (square root), FABS (absolute value), FSGN (sign), FITR (integer truncation)
- Hardware access: FADC (analog-to-digital converter), FRAN (random number generator)
- Character I/O (FOCAL-71): FIN (character input), FOUT (character output)
- User-defined: FNEW (define custom functions)
The IF Statement
FOCAL’s IF statement used a three-way branch based on whether an expression evaluated to negative, zero, or positive — similar to Fortran’s arithmetic IF:
IF (X-5) 1.1, 1.2, 1.3
This would jump to line 1.1 if X-5 is negative, line 1.2 if zero, and line 1.3 if positive.
Output Formatting
Special characters controlled output formatting:
!produced a carriage return and line feed#produced a carriage return only (allowing overprinting)- Format specifiers like
%6.02controlled numeric display width and decimal places
Sample Program
A simple FOCAL program demonstrating key features:
01.10 COMMENT TEMPERATURE CONVERSION
01.20 ASK "ENTER FAHRENHEIT TEMPERATURE", F
01.30 SET C=(F-32)*5/9
01.40 TYPE "CELSIUS EQUIVALENT IS", %6.02, C, !
01.50 GOTO 1.20
The Lunar Lander
FOCAL’s most enduring legacy may be indirect. In the fall of 1969, Jim Storer — then a high school student at Lexington High School in Massachusetts — wrote a Lunar Lander simulation game in FOCAL on a PDP-8. The player controlled a spacecraft’s thrust to achieve a soft landing on the Moon’s surface, with gravity and fuel consumption modeled mathematically.
David H. Ahl later translated this and other FOCAL programs into BASIC, first publishing them in 101 BASIC Computer Games (1973). The revised edition, BASIC Computer Games (1978), became the first million-selling computer book and helped ignite the early personal computer gaming movement. The Lunar Lander concept went on to inspire numerous adaptations, including Atari’s arcade version in 1979.
Soviet Second Life
In 1985, the Soviet Union released the Electronika BK-0010, a personal computer based on a PDP-11-compatible processor. The machine shipped with a FOCAL interpreter burned into ROM, making it the default programming language for what became the first mass-produced Soviet home computer. FOCAL was used in Soviet schools as an introductory programming language during the mid-1980s.
Around 1987, the updated BK-0010.01 replaced FOCAL in ROM with Vilnius BASIC, though FOCAL remained available as an external ROM cartridge. This transition mirrored what had happened on DEC hardware a decade earlier — BASIC ultimately displaced FOCAL wherever the two competed.
Running FOCAL Today
While no Docker image or modern implementation exists, FOCAL can still be run through several emulation paths:
- PiDP-8/I: A Raspberry Pi-based PDP-8 replica project that includes U/W FOCAL and FOCAL-69
- SimH: The widely-used computer history simulator includes a PDP-8 emulator capable of running FOCAL
- PDP-8/E Simulator (macOS): A native macOS application that includes FOCAL-8
Legacy and Significance
FOCAL occupies a specific niche in programming language history. It was not innovative in the way that LISP or ALGOL were — it was a practical simplification of JOSS for constrained hardware. Its significance lies in what it represented and what it enabled:
- Democratizing computing: FOCAL made interactive computing available on affordable minicomputers at a time when most computing required batch processing on expensive mainframes
- The Lunar Lander lineage: The game written in FOCAL by a high school student became, through translation and adaptation, one of the foundational works of computer gaming
- A cautionary tale: FOCAL’s defeat by BASIC despite being technically competitive on DEC hardware illustrates the importance of platform independence and open licensing in language adoption
- Cross-cultural computing: Its unexpected adoption in the Soviet Union on BK-0010 computers demonstrates how programming languages can find audiences far removed from their original context
Key Publications
- DEC. “FOCAL: A New Conversational Language.” DEC promotional booklet, 1969.
- DEC. “A FOCAL Primer.” 2nd edition, 1972.
- DEC. PDP-8/I FOCAL Programming Manual. DEC-08-AJAB-D.
Timeline
Notable Uses & Legacy
Lunar Lander Game
One of the earliest computer games, written by Jim Storer in FOCAL on a PDP-8 in 1969; later translated to BASIC by David Ahl and first published in '101 BASIC Computer Games' (1973), then republished in the landmark 'BASIC Computer Games' (1978)
DEC PDP-8 Scientific Computing
Served as the primary interactive computing language on PDP-8 systems in universities and laboratories for scientific calculations and data analysis in the late 1960s and early 1970s
Soviet Education (Electronika BK-0010)
Shipped in ROM on the BK-0010, the first mass-produced Soviet personal computer, and used widely in Soviet schools beginning in 1985
Laboratory Instrumentation
Used for real-time data acquisition through the built-in FADC function, which provided direct access to analog-to-digital converter hardware on PDP-8 laboratory systems