The Oberon-07 language report is 17 pages 2014-04-13

Niklaus Wirth turned 80 this year, and when stumbling on this link on HackerNews, I was reminded that I have had some notes sitting around in my drafts for a long time.

The Oberon-07 language report

You can find the PDF here

It starts with an Albert Einstein quote:

> Make it as simple as possible, but not simpler.

How Wirth influenced me

Wirth was one of my earliest computer science influences. Ever since we got a copy of Turbo Pascal, 3.3 I think, which my dad got hold of for his new PC - probably in 1987 or so -, I have been fascinated by Wirth. I don't remember why my dad got Turbo Pascal. While he did some programming, and made a living of it for many years, his focus was dBase. He may have considered using it, or it may have been because he thought I'd like it.

You can see why I was fascinated by checking out the TP 3.0 manual (PDF)

What fascinated me was the BNF for Pascal: The entire language syntax was defined in about 5 pages of BNF. As if that was not enough, I soon learned that Niklaus Wirth published on of the first Extended Backus-Naur Form descriptions (there are now many variations).

Soon I was trying to figure out how to write compilers. My earliest experiments were with Turbo Pascal, which required more knowledge of PC internals than I had. I moved back to my C64, and wrote some small initial attempts of demo-oriented micro-languages (e.g. one had a "raster" command that'd generate code for simple interrupt driven raster effects... rather specialised). Later I moved on to the Amiga, and used eventually ended up using Pascal again for one of my most serious compiler efforts.

But Wirth influenced me in deeper ways too, and the Oberon-07 language report in many ways exemplifies what I love about his languages.

For a while I wanted to study at ETH because of him, but while I didn't go ahead with that, for years I've kept track of their computer science research groups. One fun thing is that one of the speakers at the symposium for his 80th birthday was Professor Michael Franz at UC Irvine, one of Wirths Ph.D. students, whose doctoral dissertation from 1994 is one of my all time favourite papers, describing Semantic Dictionary Encoding, an alternative to "normal" CPU independent bytecode. (One of Michael Franz students again, Andreas Gal, is familiar to a lot of people who follow Javascript interpreter work, from his work on Trace Trees)

I'm deeply indebted to Wirth for setting the trajectory of the way I think about programming languages This may seem odd given how much I write about Ruby, a language which in many ways is the anti-thesis of Wirthian languages. But while I love programming in Ruby, one of my motivations for wanting to write a Ruby compiler was in fact trying to make sense of the language, and "untangling" it and trying to understand if there are ways of simplifying it while retaining it's flexibility, much in the spirit of how Wirth's language career was one long journey of reduction of complexity. And this stands as one of his most important legacies:

The simplicity of Oberon should stand as a beacon

The syntax of the entire Oberon-07 language takes up page 16 and half of page 17 of the report.

This is not news, but I like to revisit various parts of Niklaus Wirth's legacy every now and again for the simple reason that his compilers and his languages are exceptional for their simplicity.

Wirth himself has said he was vary about adding features to his language specifications that he did not have a clear idea of how to implement or how they would work. His group did plenty of research on augmentations to his languages, informing the next generation, but each specification is based on careful selection of proven features and lessons learned from the previous languages.

Oberon follows from Modula, follows from Pascal, follows from Algol-W, follows from Euler, following from Wirths work on the Algol-60 committee, presenting an unbroken chain of careful engineering stretching from the 60's until Wirths latest revisions to the Oberon-07 report quite recently (this year).

These languages are under-appreciated, which is particularly sad given the enormous success of products like Turbo Pascal and later Delphi that shaped a huge number of programmers.

It is also particularly silly since these languages are so small and simple to learn. It is 17 pages. And it is not 17 pages of mathematical notation or hugely complicated ideas. It is 15 pages of mostly prose and a few tables, and 1.5 pages of the syntax re-stated formally in BNF.

It is simple prose. Consider section 2. Syntax:

> A language is an infinite set of sentences, namely the sentences well formed according to its > syntax. In Oberon, these sentences are called compilation units. Each unit is a finite sequence of > symbols from a finite vocabulary. The vocabulary of Oberon consists of identifiers, numbers, > strings, operators, delimiters, and comments. They are called lexical symbols and are composed of > sequences of characters. (Note the distinction between symbols and characters.) > > To describe the syntax, an extended Backus-Naur Formalism called EBNF is used. Brackets [ and ] > denote optionality of the enclosed sentential form, and braces { and } denote its repetition (possibly > 0 times). Syntactic entities (non-terminal symbols) are denoted by English words expressing their > intuitive meaning. Symbols of the language vocabulary (terminal symbols) are denoted by strings > enclosed in quote marks or by words in capital letters.

That's it. The BNF rules for the various parts of the language are then presented in each relevant section, as well as restated in the final two pages in one go.

Updated: Fixed the article link; corrected to take into account Paul McJones comments on chronology of Euler and Algol-W

blog comments powered by Disqus