← the guideThe Systems Age

§ 02 — Eras · 1967

Simula 67

objects invented — to simulate ships in a fjord

Left: era context, features, and the 101 hello. Right: 3 core concepts, 3 deeper 201 lessons, the factorial specimen, and where Simula 67 lives today — each column scrolls on its own.

creators
Ole-Johan Dahl & Kristen Nygaard, Oslo, 1967
status
historical · the idea runs the industry
lineage
→ Smalltalk-80⇢ C++

The problem it solves

Simulating ships and harbors didn’t fit procedural decomposition. Simula let the program mirror the world: things, with behavior.

The problem it carries

Slow, niche, and mainframe-bound — the mainstream would spend a decade ignoring the idea it had handed them.

Key features

the class
Data and the procedures that own it, packaged together behind one interface.
inheritance
A subclass refines its parent — the first object-oriented inheritance in any language.
ref and new
References separate identity from object, making shared structures and graphs expressible.
coroutines
Two routines that suspend and resume each other — the ancestor of generators, fibers and async/await.

101 — hello, world

Session one is the smallest program that still counts as speaking Simula 67: what every tutorial prints first, in the dialect that mattered when the language arrived (1967).

the first program1967
OutText ("Hello, world");
OutImage;

101First contact — hello world and 3 ideas that define how Simula 67 reads. 201 — 3 lessons on mechanisms you meet after the factorial specimen: the sharp edges practitioners actually use.

101 — core concepts

3 fragments, each naming a habit of mind in Simula 67. Read the note, then the code — together they are the 101 in one sitting.

01 — the class

Data and the procedures that own it, stamped into objects by new.

Ship class Ship (x, y); real x, y;
begin
  real procedure position; ...
end;

02 — ref & new

References (:—) separate names from objects — garbage collection followed.

ref (Ship) s;
s :- new Ship (0.0, 0.0);

03 — virtual procedures

Subclasses replace behavior — inheritance, thirty years before Java.

Ship class Tanker;
begin
  virtual procedure draw; ...;
end;

201 — going deeper

The 201 assumes you have read the 101 and the specimen. Each lesson is one mechanism — what it is for, how it looks in code, and the trap or payoff that makes Simula 67 distinctive at scale.

  1. virtual procedures
  2. prefixed class lists
  3. coroutines and inspection

virtual procedures

A subclass may replace a procedure declared virtual in its parent; the call then dispatches on the actual object type — the mechanism behind every later override.

class Vessel;
  virtual procedure (integer) speed := ...;
end;

class Ferry;  class Ship (0,0);
  procedure (integer) speed;  ...;
end;

prefixed class lists

A class may inherit from several parents at once, with prefixed names resolving conflicts — the ancestor of mixins and multiple inheritance.

class B (A, B);  ! inherits from both
  A procedure (real) p;
  B procedure (real) q;
end;

coroutines and inspection

Co-routines interleave two routines through a shared stack, and inspection asks an object what class it really is — dynamic type tests, 1967 style.

The specimen — factorial

The class: data and the procedures that own it, bundled and stamped into objects — invented to simulate ships in a Norwegian fjord, ended up simulating everything else.

the class1967
class Ship (x, y);  real x, y;
begin ... end;

ref (Ship) s;
s :- new Ship (0.0, 0.0)

Run it today

installbrew install cim

runcim fact.sim && ./a.out

Where it is now

Its children are everywhere: Smalltalk, C++, Java, and every class keyword on Earth.