Why Oberon

Code your AI writes, and you can read.

More and more software is written by models. Writing it was never the hard part. Reading it is: knowing exactly what a program does before you trust it. Oberon 07z is a systems language built for that reader.

Reading is the bottleneck

A model can produce a thousand lines of C or Rust in a minute. Someone still has to read them: the designer who owns the system, the reviewer who signs it off, the engineer who debugs it at two in the morning. That reading is now the slowest and most important step, and the language decides how hard it is.

In C, one line can hide several operations and an order of evaluation:

C
a = ***b++;

Three dereferences, a pointer advanced as a side effect, and no checks. Rust is safer, and still asks a lot of its reader. This is a valid function signature:

Rust
fn tokens<'a, T>(src: &'a T) -> impl Iterator<
    Item = Result<&'a str, Box<dyn Error + Send + Sync + 'a>>,
> + 'a
where
    T: AsRef<str> + ?Sized,

Both are fine languages for people who use them every day. But when the author is a model and the reader is you, every hidden step is one more thing to work out before you can trust the code.

Oberon writes each step as a step. This is a real procedure from the standard library, appending bytes to a buffer:

Buf.ob
PROCEDURE Append*(src: ARRAY OF BYTE; srcAt: INTEGER; count: INTEGER; VAR b: Buffer): BOOLEAN;
VAR used: INTEGER; ok: BOOLEAN;
BEGIN
  used := Length(b);
  ok := (used >= 0) & (count >= 0) & (count <= MaxCapacity - used);
  IF ok THEN
    ok := Arena.CopyIn(src, srcAt, b, Header + used, count);
    IF ok & (count > 0) THEN ok := PublishLength(b, used + count) END
  END;
  RETURN ok
END Append;

Every check is written out, every call into another module names it, and the result is one plain value. You can read it once and know what it does.

The whole language fits in a prompt

Wirth's report for Oberon-07 is 17 pages, and it defines the entire language. The 07z additions fit on one more page. Together they fit in a model's context with room to spare, so a model works from the actual definition, not from patterns half-remembered across millions of programs.

Models already know Oberon's syntax: Wirth's reports, Project Oberon and open-source Oberon compilers have been public for decades. Because the language is small, there's little for them to get wrong, and when they do, the mistake is easy to see.

The same holds for people. An engineer can read the whole definition in an evening, and from then on there's no corner of the language they haven't seen.

Less that can go wrong

A small language is also a short list of ways to fail. In Oberon 07z:

  • There's no pointer arithmetic, no ++, and assignment is a statement, not an expression. A line does one thing.
  • Array indexes are checked, and integer arithmetic stops on overflow instead of wrapping.
  • New storage starts zeroed, and INTEGER, LONGINT and REAL never mix unless the program converts them.
  • There are no macros and no preprocessor, so the code you read is the code that runs.
  • A module exports only what it marks, and every use of an imported name says which module it comes from.
  • Memory has a visible owner. Data lives in buffers the caller owns, or in an arena with an explicit lifetime, and a block is refused once its arena is released.

When a model writes Oberon, this is the whole list a reviewer has to keep in mind. The model is the author, and you stay the architect, the designer and the reader.

A systems language all the way down

Small doesn't mean limited. Wirth and Gutknecht wrote an entire operating system in Oberon, with its compiler, editor and user interface, and described all of it in one book. Oberon is the same kind of language as C: the kind operating systems, databases and network services are written in.

Oberon 07z compiles to native executables with no garbage collector, calls C directly, and comes with a standard library for files, TCP and time, plus packages for TOML configuration and HTTP. One language, from the lowest layer of a system to the services that run on it.

Compared with C, Go and Rust

C

Oberon 07z works at C's level and calls C directly, so existing libraries stay usable. It adds checked arrays, overflow traps and real modules, with no header files to keep in step and no preprocessor.

Go

Go and Oberon are relatives: Go's designers name the Pascal, Modula and Oberon family among its influences. The difference is the runtime. Go has a garbage collector and a scheduler, and Oberon 07z has neither.

Rust

Rust proves more at compile time. Its ownership rules rule out whole classes of memory errors before a program runs, and that's a real achievement. It pays for it in size. Oberon 07z checks at run time instead, and stays small enough that the code itself is easy to review. If you need the compiler to prove memory safety, choose Rust. If you need people to read every line a model writes, choose Oberon.

Next: the 07z dialect, and why each addition is there →