The first high-level programming language, running again.
Plankalkul ("Plan Calculus") was designed by Konrad Zuse between 1942-1945. Building on the pioneering work of Rojas et al. (FU Berlin, 2000) who created the first implementation, this package provides an accessible Python interface.
pip install plankalkulfrom plankalkul import run
# Calculate factorial
result = run('''
P1 factorial (V0[:8.0]) => R0[:8.0]
1 => R0[:8.0]
1 => Z0[:8.0]
W [ Z0[:8.0] * R0[:8.0] => R0[:8.0]
Z0[:8.0] + 1 => Z0[:8.0] ] (Z0[:8.0] <= V0[:8.0])
END
''', 5)
print(result['R0']) # 120Or run from command line:
plankalkul # Runs demo programs| Feature | Plankalkul (1945) | First "Modern" Language |
|---|---|---|
| Data structures | Yes | C (1972): 27 years later |
| User-defined types | Yes | C (1972): 27 years later |
| Assertions | Yes | Eiffel (1986): 41 years later |
| Structured control | Yes | ALGOL (1960): 15 years later |
The first language had features that took decades to "reinvent".
P<number> <name> (<parameters>) => <returns>
<statements>
END
| Prefix | Meaning |
|---|---|
V0, V1... |
Input parameters |
Z0, Z1... |
Local/intermediate variables |
R0, R1... |
Return values |
[:8.0] ; 8-bit integer
[:1.0] ; 1-bit (boolean)
[:16.0] ; 16-bit integer
[:n×m.0] ; n×m array
| Operation | Symbol | ASCII Alternative |
|---|---|---|
| Assignment | → |
=> |
| Multiply | × |
* |
| Divide | : |
/ |
| Not equal | ≠ |
!= |
| Less/equal | ≤ |
<= |
| Greater/equal | ≥ |
>= |
| Logical AND | ∧ |
& |
| Logical OR | ∨ |
| |
| Logical NOT | ¬ |
! |
Conditional:
(condition) => statement
While loop:
W [ statements ] (condition)
Counted loop (W1):
W1 (count) => counter_var { statements }
The W1 loop iterates from 0 to count-1, storing the current iteration in counter_var. This syntax was reconstructed from academic implementations based on Zuse's manuscripts.
P1 max (V0[:8.0], V1[:8.0]) => R0[:8.0]
V0[:8.0] => R0[:8.0]
(R0[:8.0] < V1[:8.0]) => V1[:8.0] => R0[:8.0]
END
P2 factorial (V0[:8.0]) => R0[:8.0]
1 => R0[:8.0]
1 => Z0[:8.0]
W [ Z0[:8.0] * R0[:8.0] => R0[:8.0]
Z0[:8.0] + 1 => Z0[:8.0] ] (Z0[:8.0] <= V0[:8.0])
END
P3 sum (V0[:8.0]) => R0[:8.0]
0 => R0[:8.0]
1 => Z0[:8.0]
W [ R0[:8.0] + Z0[:8.0] => R0[:8.0]
Z0[:8.0] + 1 => Z0[:8.0] ] (Z0[:8.0] <= V0[:8.0])
END
P Factorial(V0[:8.0]) => R0[:8.0]
1 => R0[:8.0]
W1 (V0[:8.0]) => Z0[:8.0] {
R0[:8.0] * (Z0[:8.0] + 1) => R0[:8.0]
}
END
This advanced syntax comes from the Hovestar implementation, reconstructed from Zuse's manuscripts.
| Year | Event |
|---|---|
| 1936 | Zuse builds Z1 (mechanical computer) |
| 1941 | Z3 completed (first programmable computer) |
| 1942-45 | Plankalkül designed |
| 1943 | Z3 destroyed in Allied bombing |
| 1945 | WWII ends, Zuse flees with Z4 |
| 1948 | Zuse writes manuscript "Der Plankalkül" |
| 1972 | Plankalkül published |
| 2000 | First implementation (FU Berlin) |
| 2025 | This implementation (The Ian Index) |
- War: Designed during WWII, destroyed in bombing
- Language barrier: Written in German
- Isolation: Zuse didn't know about Turing or von Neumann
- Politics: Work in Nazi Germany carried stigma
- Commercial failure: No resources to implement
Plankalkul had features that took decades to "reinvent":
- Data structures (like C structs): reinvented 27 years later
- User-defined types: reinvented 27 years later
- Assertions: reinvented 41 years later
- Strong typing: reinvented 25 years later
- Structured control flow: reinvented 15 years later
Source Code → Lexer → Tokens → Parser → AST → Interpreter → Result
- Lexer: Handles both Unicode (→, ×, ≤) and ASCII (=>, *, <=) notation
- Parser: Recursive descent parser
- Interpreter: Tree-walking interpreter with variable scoping
- Type System: Basic type checking (integers, booleans, arrays)
MIT License — completing Zuse's public domain vision.
🎮 Zuse Chess (1942) — Play Konrad Zuse's chess algorithm in your browser. The first chess program ever written, reconstructed from 78 pages of original manuscripts.
- Zuse, K. (1948). "Der Plankalkül"
- Rojas, R. et al. (2000). "Plankalkül: The First High-Level Programming Language and its Implementation"
- Bauer, F.L. & Wössner, H. (1972). "The 'Plankalkül' of Konrad Zuse: A Forerunner of Today's Programming Languages"
"The significance of Plankalkül lies not in what it became, but in what it could have been."
Konrad Zuse deserves to be remembered.