Est. 1968 Beginner

Focal-8

FOCAL-8, DEC's name for Richard Merrill's FOCAL interpreter on the 12-bit PDP-8 family: a conversational calculator language that ran in 4K words of core and shared one machine among up to seven Teletypes.

Created by Richard M. Merrill (Digital Equipment Corporation)

Paradigm Procedural, Imperative, Interactive
Typing Untyped (every value is a floating-point number)
First Appeared 1968 (preliminary manual March 1968); the FOCAL-8 name is on DEC manuals by January 1970
Latest Version FOCAL, 1969 (the last DEC PDP-8 release found in the DEC manuals examined for this page)

FOCAL-8 is the name Digital Equipment Corporation (DEC) gave to its FOCAL interpreter for the 12-bit PDP-8 family of minicomputers. FOCAL was an interactive language written by Richard M. Merrill and descended from RAND’s JOSS. A user sat at a Teletype and typed TYPE FSQT(2) to get an answer at once. The same commands, given line numbers, became a stored program. The whole system, including the editor, the interpreter, the floating-point package and the user’s program, had to fit in a PDP-8 with only 4,096 twelve-bit words of core memory.

This page covers the PDP-8 implementation and its documented history. The general FOCAL page covers the language family as a whole, including FOCAL-11 and the later Soviet versions.

History & Origins

From JOSS to a 4K minicomputer

JOSS had shown at RAND that people who were not programmers would use a computer if they could talk to it in short English commands and get answers right away. DEC’s PDP-8, however, was a small machine, and its basic configuration had only 4K words of core. Merrill’s FOCAL kept the JOSS style of working (direct commands, numbered lines, TYPE and SET, two-part line numbers) and removed or simplified everything that did not fit.

The documents show how quickly it became a product:

  • March 1968: An Introduction to FOCAL, labelled a “Preliminary Programming Manual”, for the PDP-8, PDP-8/S and PDP-8/I. Its stated hardware requirement is a “4K PDP-8/I, PDP-8, or PDP-8/S computer with ASR 33 Teletype.”
  • April 1968: the first printing of the FOCAL Programming Manual. Its error table “appl[ies] only to the version of FOCAL, 1968.”
  • 1969: a revised interpreter, identified on screen as FOCAL,1969. The DECUS-distributed assembly listing of “FOCAL 5/69” has a source header crediting Rick Merrill and describing the program as “for the family of 8.”
  • January 1970: the sixth printing of the manual (the third revised one) carries the title FOCAL-8 Programming Manual.

Why “FOCAL-8”?

The “-8” separated the PDP-8-family program from versions DEC was writing for its other machines. The January 1970 manual is the earliest DEC document examined for this page that uses FOCAL-8 as its title. Its preface says the manual is “intended for anyone desiring to learn and use FOCAL-8”. The earlier printings were simply called FOCAL. It is not known whether the July 1969 revised printing already used the new title. DEC soon had a FOCAL-12 for the PDP-12 (a listing is dated January 1971), a FOCAL for the PDP-15 (manual dated October 1970) and Merrill’s FOCAL-11 for the PDP-11. The preliminary FOCAL-11 document, dated 16 February 1971, takes FOCAL-8 as its reference point:

FOCAL-11 is identical to FOCAL-8 for the user with the exception of the error diagnostics…, the symbol table typeout…, and additional features.

The encyclopedia’s 1970 date for Focal-8 matches when the name appears in print. The software itself dates from 1968, which is why this page uses 1968 as its year.

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

Design Philosophy

DEC promoted FOCAL-8 as a calculator first and a programming language second. The 1969 pocket card’s headline promises that users can “learn to use a computer as a sophisticated calculator in minutes”, and its subhead adds that they can “learn to write computer programs in a few hours”. The 1970 manual says FOCAL is “widely used by mathematics teachers in both secondary schools and colleges”.

Memory constraints shaped the design:

  • Every command starts with a different letter, so T means TYPE, S means SET, A means ASK, and so on. The interpreter only needs the first letter, and users can type programs in abbreviated form to save core.
  • The user decides how big the math library is. When FOCAL-8 starts, it asks whether to keep the log, exponential and arctangent functions, then whether to keep 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 extended functions are discarded.
  • There is one data type. Every variable is a floating-point number, calculated by default to six significant digits.

The start-up dialogue, as printed in the 1970 manual:

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.
*

Key Features

Direct and indirect commands

A line typed without a number runs immediately. A line with a number is stored. Line numbers run from 1.01 to 31.99. The part before the point is the group and the part after it is the step. A whole group can be called as a subroutine (DO 5), listed (WRITE 2) or deleted (ERASE 4). GO runs the program from its lowest line.

*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 FOR command repeats the rest of its own line. A loop body longer than one line is therefore written as a group and called with DO, as in line 1.30 above. With three values, FOR takes the order start, increment, end, as in the manual’s FOR B=1,1,5.

The commands

CommandAbbrev.Purpose
TYPETPrint expressions, text and formatting characters
ASKARead numbers from the keyboard into variables
SETSAssign a value
DODRun a line or group as a subroutine
GO / GOTOGStart the program / jump to a line
IFIThree-way branch on the sign of an expression
FORFLoop over the rest of the line
RETURNRReturn early from a DO
QUITQStop the program
COMMENTCRemark
WRITEWList the program
ERASEEDelete variables, lines, groups or the whole program
MODIFYMEdit a line character by character

A three-way IF

Like Fortran’s arithmetic IF, FOCAL-8’s IF branches to the first, second or third line number when its expression is negative, zero or positive. This example is from the 1970 manual:

*2.1 TYPE "LESS THAN ZERO"; QUIT
*2.3 TYPE "EQUAL TO ZERO"; QUIT
*2.5 TYPE "GREATER THAN ZERO"; QUIT
*IF (25-25)2.1,2.3,2.5
EQUAL TO ZERO*

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, execution continues with the next statement.

Output formatting

TYPE uses ! for carriage return plus line feed and # for a carriage return alone, which lets output be overprinted to plot a second variable on the same line. Formats are set with %x.yz. The default is %8.04, eight digits with four after the point. %, on its own switches to E-notation. The manual uses 300 factorial to show the exponent range:

*SET A=1
*FOR I=1,300; SET A=A*I
*TYPE %, A
= 0.306051E+615*

TYPE $ prints the whole symbol table. Variable names can be longer than two characters, but only the first two count. A name may not begin with F, which is reserved for functions. Subscripts can range over ±2047.

Functions

Function names are four letters beginning with F. The 1970 manual’s summary lists square root, absolute value, sign part, integer part and a random-number generator (FSQT, FABS, FSGN, FITR, FRAN) as standard functions. The extended functions (FEXP, FSIN, FCOS, FATN, FLOG) are the ones offered in the start-up dialogue, and they use roughly 800 locations of program space. The input-output functions include FRAN, a random-number function that the manual says “uses the FOCAL program itself as a table of random numbers”. It also includes FADC for an analog-to-digital converter and FDIS for plotting points on an oscilloscope display. Those hardware functions explain why the 1970 manual lists a laboratory converter and display among FOCAL-8’s optional equipment.

Errors as numbers

FOCAL-8 had no room for error text. A mistake produces a question mark and a code. Inside a program, the code is followed by the line where the error occurred:

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

The manual describes the code as “an arbitrary number indicating the type of error” and lists what each one means in an appendix. ?03.28 is an illegal command.

Evolution

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)
4WORDExtended precision: about 10 significant digits instead of 6
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

Much of the later FOCAL work started from the PDP-8 version:

  • FOCAL-11 (1971 onward), Merrill’s PDP-11 version, described as identical to FOCAL-8 for the user apart from a few differences.
  • PS/8 FOCAL, 1971 (DECUS FOCAL8-177), patches to FOCAL, 1969 from the Oregon Museum of Science and Industry that add 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” for DEC’s Microprocessor Series modules. It offered about 2.6K bytes of user space in a 12K system.
  • U/W FOCAL from the University of Washington (manual V4E, October 1978), which its manual calls “an advanced version of FOCAL” for 8K and larger PDP-8 systems.

Losing to BASIC

FOCAL-8 was DEC’s own language. BASIC ran on many manufacturers’ machines and already had a large body of shared educational programs. DEC’s PDP-8 education group responded with BASIC-based “EduSystem” packages and, according to later histories, David Ahl began porting FOCAL programs into BASIC, among them The Sumer Game (around 1971) and Storer’s lunar-landing game. They became famous in their BASIC versions through 101 BASIC Computer Games (1973). As a result, FOCAL-8’s best-known programs reached most readers in another language.

Current Relevance

FOCAL-8 is a historical language with no maintained implementation. It is still easy to run on emulated hardware:

  • The SIMH project’s software kits include FOCAL69 for the PDP-8, credited as “courtesy of Digital Equipment Corporation”, for SIMH’s PDP-8 simulator.
  • The PiDP-8/I replica project lists FOCAL-69 among the software its documentation covers. Its standard OS/8 boot disk includes U/W FOCAL V4E, and the project publishes a reformatted version of the U/W FOCAL manual.
  • 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. Few early interpreters are this thoroughly documented.

There is no official or community Docker image.

Why It Matters

FOCAL-8 showed that an interactive, JOSS-style language could run in 4K words of a minicomputer that cost far less than the larger machines JOSS had run on. It could even be shared by four or seven people at once. DEC aimed it at teachers, students and laboratory users, and for many of them it was probably their first conversational use of a computer.

It also had an unusual influence on games. King of Sumeria, the ancestor of Hamurabi, and Storer’s lunar-landing simulation, widely cited as the first Lunar Lander game, were both FOCAL programs. Their designers had to fit them alongside the interpreter in a 4K PDP-8. The Lunar Landing write-up warns that the extended functions cannot be retained when it runs. The language’s main legacy may be those programs, which became famous after they were ported to BASIC.

Timeline

1968
In March, DEC issues "An Introduction to FOCAL", a preliminary programming manual (DEC-08-AJAA-D) for 4K PDP-8, PDP-8/S and PDP-8/I computers with an ASR-33 Teletype
1968
In April, DEC prints the first edition of the FOCAL Programming Manual (DEC-08-AJAB-D). Its diagnostics are for the version called FOCAL, 1968, and it adds the LAB-8 and LINC-8 to the supported machines
1969
DEC's Advanced FOCAL Technical Specifications (DEC-08-AJBB-DL, first printed April 1969) describe FOCAL, 1969 with overlays for 8K memory, four-word extended precision and four-user time-sharing
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 is titled the FOCAL-8 Programming Manual (DEC-08-AJAD-D). It covers the PDP-5, PDP-8, 8/S, 8/I, 8/L, LINC-8 and PDP-12 and lists the FOCAL, 1969 tape set as of 12 December 1969, including 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
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. The write-up is dated 23 August 1971
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
The University of Washington's U/W FOCAL manual, version V4E, is dated October 1978. U/W FOCAL is an extended FOCAL for the PDP-8 that needs at least 8K words of memory

Notable Uses & Legacy

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.

Lunar Landing Simulation

James Storer's text-mode Apollo landing game, written in FOCAL, 1969 at Lexington High School and distributed by DECUS as FOCAL8-81. It is widely regarded as the first game of the Lunar Lander genre.

Cornell University biology teaching

Howard C. Howland wrote A FOCAL Primer (2nd edition, 1972) for his interactive-computing course, Biological Sciences 106, and for users of the Division of Biological Sciences Interactive Computing Facility at Cornell.

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

JOSS

Influenced

FOCAL-11 U/W FOCAL

Running Today

Run examples using the official Docker image:

docker pull
Last updated: