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 — Eras · 1967
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.
Simulating ships and harbors didn’t fit procedural decomposition. Simula let the program mirror the world: things, with behavior.
Slow, niche, and mainframe-bound — the mainstream would spend a decade ignoring the idea it had handed them.
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).
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.
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;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.
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;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;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 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.
class Ship (x, y); real x, y;
begin ... end;
ref (Ship) s;
s :- new Ship (0.0, 0.0)installbrew install cim
runcim fact.sim && ./a.out
Its children are everywhere: Smalltalk, C++, Java, and every class keyword on Earth.