Idea · Oct 16, 2026

Build Your Own FORTRAN I Compiler

For Fortran's 70th birthday, students build a compiler for a FORTRAN I subset that targets a simulated IBM 704 with only three index registers, and reproduce the original team's bet that compiled code could rival hand-written assembly.

What it would do

The first Fortran manual appeared 70 years ago (15 October 1956), and Backus's team's real achievement was not the language but an optimizing compiler good enough that 704 programmers would accept it. In this assignment students recreate that story at small scale. They are given a 704-like simulator (36-bit words, accumulator and MQ, three index registers, cycle counts per instruction) and a FORTRAN I subset: fixed-form statements, integer and floating variables, one- and two-dimensional arrays, arithmetic IF, GO TO, and DO loops. Milestone 1 is a fixed-form lexer and parser. Milestone 2 translates arithmetic expressions, first with the original trick of inserting parentheses to encode precedence, then with a modern precedence-climbing parser for comparison. Milestone 3 compiles DO loops and subscripted array references, which is where the original's index-register work mattered. Milestone 4 allocates the three index registers using estimated execution frequencies (from loop nesting, then from profiling runs) and measures spill cost. Milestone 5 pits each student's output against provided hand-written 704 assembly on a benchmark set and reports the cycle-count ratio, mirroring the 1957 claim.

Key features

  • Provided IBM 704-style simulator with cycle-accurate counts and only three index registers
  • FORTRAN I subset spec with a test suite of period-appropriate numerical programs
  • Two expression translators (historical parenthesization trick vs precedence climbing) compared side by side
  • Frequency-guided index-register allocation with measured spill cost
  • Final benchmark against hand-written assembly with a cycle-ratio leaderboard

More in Systems & Hardware

Pull the Pin

A chip-and-bus level simulator of a tiny 8-bit computer for architecture courses where instructors break chips, pins, and bus lines, and students diagnose the fault from symptoms like a hardware repair tech.

BuiltSystems & HardwareProduct for a businessOct 18, 2026

Strictly C

A portability lab for systems courses that compiles each student's C code under several compilers, standards, and architectures, then explains every place where the program relied on undefined, unspecified, or implementation-defined behavior.

Systems & HardwareTeaching toolMediumOct 15, 2026

Build Your Own Borrow Checker

A staged compilers or PL course project where students implement ownership, moves, and borrow checking for a tiny Rust-like language, ending with a fuzzing hunt for unsound programs their own checker wrongly accepts.

Systems & HardwareClass assignmentLargeOct 14, 2026

Build Your Own Resumable Download Manager

A staged networking assignment in which students build a GetRight-style download manager with HTTP range requests, parallel segments, validators and checksums, graded against a chaos server that drops connections, rotates URLs and silently changes files mid-download.

Systems & HardwareClass assignmentLargeOct 13, 2026

All 39 ideas in Systems & Hardware →