Est. 1968 Intermediate

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

Also known as: FOCAL-8

Created by Richard Merrill

Paradigm Procedural, Imperative, Interactive
Typing Dynamic, Weak
First Appeared 1968
Latest Version FOCAL-69 (1969)

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.

DEC’s PDP-8 education group answered BASIC’s large body of shared educational programs with its own BASIC-based “EduSystem” packages.

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. T for TYPE, S for SET, A for ASK, and so on. This saved both typing time and memory.
  • Two-part line numbers: Lines are numbered in a group.line format (e.g., 01.10, 02.30). Groups function as logical units that can be called as subroutines with DO or erased as a unit with ERASE.
  • 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:

CommandPurpose
ASKPrompt for and accept user input
SETAssign values and perform calculations
TYPEDisplay output with formatting
FORLoop iteration
IFThree-way conditional branch (negative/zero/positive)
GOTOTransfer control to a line
DOCall a group as a subroutine
RETURNReturn from a subroutine call
ERASEDelete lines or groups
WRITEDisplay program listing
COMMENTProgram documentation
QUITExit 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.02 controlled 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

FOCAL-8 on the PDP-8

FOCAL-8 is the name DEC gave to its FOCAL interpreter for the 12-bit PDP-8 family. The “-8” separated that program from the versions DEC was writing for its other machines, including FOCAL-12 for the PDP-12, a FOCAL for the PDP-15 and Merrill’s FOCAL-11 for the PDP-11. Earlier printings of the manual were simply called FOCAL. The January 1970 printing, titled the FOCAL-8 Programming Manual, is the earliest DEC document examined for this history that uses the name as a title.

DEC’s manuals spell out the acronym in two ways. The 1968 manual uses “Formulating On-Line Calculations in Algebraic Language”, while the 1970 FOCAL-8 manual and DEC’s 1969 pocket card use “FOrmula CALculator”.

Choosing the size of the math library

The editor, interpreter, floating-point package and user program all shared the same 4,096 words of core, so FOCAL-8 let the user decide how much of the math library to keep. At start-up it asked whether to retain the log, exponential and arctangent functions, and then whether to retain sine and cosine. The 1970 manual gives about 700 free locations for user programs if all functions are kept, about 900 if only sine and cosine are kept, and 1,100 if all the extended functions are discarded.

CONGRATULATIONS!!
YOU HAVE SUCCESSFULLY LOADED 'FOCAL,1969' ON A PDP-8 COMPUTER.
SHALL I RETAIN LOG, EXP, ATN ?:NO
SHALL I RETAIN SINE, COSINE ?:NO
PROCEED.
*

Direct and indirect commands

A line typed without a number runs immediately, and a line with a number is stored. Line numbers run from 1.01 to 31.99, and the two parts are the group and the step. GO runs the program from its lowest line, and MODIFY edits a line character by character.

FOR repeats the rest of its own line, so a loop body longer than one line is written as a group and called with DO, as in line 1.30 below. With three values, FOR takes the order start, increment, end, as in the manual’s FOR B=1,1,5.

*1.10 ASK "HOW MANY TERMS", N
*1.20 SET S=0
*1.30 FOR I=1,N; DO 2
*1.40 TYPE "SUM OF SQUARES", S, !
*1.50 QUIT
*2.10 SET S=S+I*I
*GO

The language has no relational operators. To test X > 5, a program branches on the sign of X-5. If a line number is left out of an IF, execution continues with the next statement.

Output, variables and errors

The default output format is %8.04, eight digits with four after the point, and %, on its own switches to E-notation. TYPE $ prints the whole symbol table, and subscripts can range over ±2047. FDIS plots points on an oscilloscope display, and the manual says FRAN “uses the FOCAL program itself as a table of random numbers”.

FOCAL-8 had no room for error text. A mistake produces a question mark and a code, followed inside a program by the line where the error occurred. The manual describes the code as “an arbitrary number indicating the type of error” and lists the meanings in an appendix. ?03.28 is an illegal command:

*SET A=2; PET B=4; TYPE A+B
?03.28

Overlays and time-sharing

By 1969 FOCAL-8 could be extended with overlays, extra paper tapes loaded on top of the base interpreter:

OverlayWhat it added (per the 1970 manual)
8KMore memory for larger programs on an 8K machine
CLINE, PLOTR, GRAPHGraphics functions for an incremental plotter or a KV8 display
QUADFour users sharing FOCAL on an 8K PDP-8
LIBRASeven users on an 8K PDP-8 with disk, plus a LIBRARY command to save and load programs

DEC marketed this multi-user support on price. Its 1969 pocket card offered seven simultaneous users on one PDP-8/I “at the lowest per user cost ever” and named schools first among the likely buyers.

Descendants of FOCAL-8

  • FOCAL-11 (1971 onward), Merrill’s PDP-11 version, took FOCAL-8 as its reference point.
  • PS/8 FOCAL, 1971 (DECUS FOCAL8-177) added file commands under PS/8, the DEC operating system that became OS/8.
  • FOCAL/MPS (DEC SPD, February 1976), “a modified version of FOCAL-8”, offered about 2.6K bytes of user space in a 12K system.
  • U/W FOCAL, which its manual calls “an advanced version of FOCAL”, needs at least 8K words of memory.

FOCAL-69 can be run today from the SIMH software kits, which credit it as “courtesy of Digital Equipment Corporation”. Bitsavers keeps scans of the 1968 and 1970 DEC manuals, the Advanced FOCAL Technical Specifications, DECUS FOCAL8 write-ups and the FOCAL, 1969 assembly listing.

The Lunar Lander

FOCAL’s best-known 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.

Storer’s program reached other PDP-8 users through DECUS, the DEC user society, as FOCAL8-81. Its write-up warns that the extended functions cannot be retained when it runs, because the game had to fit alongside the interpreter in a 4K machine.

A second FOCAL game took the same path into BASIC. King of Sumeria, a Sumerian city-economy simulation also known as The Sumer Game, appears as a program tape in DEC’s December 1969 list of FOCAL software. According to later histories, Ahl began porting it around 1971, and it became famous as Hamurabi.

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, when BASIC displaced FOCAL.

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. It matters for 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 carried the language far from its 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

1968
Richard Merrill writes the first FOCAL interpreter at Digital Equipment Corporation for the PDP-8 minicomputer
1968
In March, DEC issues 'An Introduction to FOCAL', a preliminary programming manual for 4K PDP-8, PDP-8/S and PDP-8/I computers with an ASR-33 Teletype. The first edition of the FOCAL Programming Manual follows in April
1969
FOCAL-69 released publicly by DEC with a major promotional campaign; becomes the standard interactive language for PDP-8 systems
1969
Jim Storer, a high school student at Lexington High School, writes the Lunar Lander game in FOCAL for the PDP-8
1969
A DEC FOCAL pocket card announces multi-user FOCAL: up to seven users at once on one PDP-8/I
1970
DEC's January 1970 printing of the manual is titled the FOCAL-8 Programming Manual. It covers the PDP-5, PDP-8, 8/S, 8/I, 8/L, LINC-8 and PDP-12 and lists the QUAD (four-user) and LIBRA (seven-user) overlays
1970
James A. Storer's 'FOCAL Lunar Landing Simulation (APOLLO)', sent in by his Lexington High School teacher Walter Koetke, joins the DECUS library as FOCAL8-81. The write-up is dated 20 January 1970
1971
FOCAL-71 released with updates including changed FSGN(0) behavior and new FIN/FOUT character I/O functions
1971
Richard Merrill's preliminary FOCAL-11 description, dated 16 February 1971, says the PDP-11 version is identical to FOCAL-8 for the user apart from its error diagnostics, symbol-table printout and some added features
1971
PS/8 FOCAL, 1971, a set of patches to FOCAL, 1969 that adds device-independent file handling under the PS/8 operating system, is submitted to DECUS (FOCAL8-177) from the Oregon Museum of Science and Industry
1972
DEC publishes the second edition of 'A FOCAL Primer', a tutorial guide for learning the language
1976
A DEC Software Product Description dated February 1976 describes FOCAL/MPS as a modified version of FOCAL-8 for DEC's Microprocessor Series modules
1978
Jim van Zee at the University of Washington documents U/W FOCAL, a significantly extended variant, distributed through DECUS
1985
The Soviet Electronika BK-0010 personal computer ships with a FOCAL interpreter in ROM, introducing the language to a new generation of users
1987
The BK-0010.01 reportedly replaces FOCAL with Vilnius BASIC in ROM (exact year uncertain; sources range from 1986 to 1989); FOCAL moved to an external ROM cartridge option

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

King of Sumeria (The Sumer Game)

A Sumerian city-economy simulation written in FOCAL for a minimal PDP-8. DEC's December 1969 list of FOCAL software includes it as a program tape. Later histories credit it to Doug Dyment, a DEC employee; DEC's own 1969 list names no author. David Ahl later ported it to BASIC as Hamurabi

Oregon Museum of Science and Industry

OMSI's software group produced PS/8 FOCAL, 1971 (by David Schneider and Barry Smith), which gave FOCAL programs access to the file system of DEC's PS/8 operating system

DECUS FOCAL8 program library

The DEC user society kept a separate FOCAL8 library of user-written programs, from statistics to games such as Life, Checkers and Monopoly. Its May 1975 catalog update lists entries numbered as high as FOCAL8-316

Language Influence

Influenced By

Running Today

Run examples using the official Docker image:

docker pull

Related Languages

Sources & Further Reading

Last updated: