OBNC

OBNC is a compiler for Niklaus Wirth’s programming language Oberon. It implements the latest version of the language from 2016. OBNC translates source code written in Oberon to the lower-level programming language C. The translated code is then compiled and linked using the C compiler and linker of the host operating system. The build command obnc performs all these tasks and keeps track of which files need to be compiled or recompiled.

The compiler is released under the GNU General Public License while the libraries are released under the Mozilla Public License. With the Mozilla license an Oberon project compiled with OBNC can be released under any license.

See the changelog for latest updates, and MD5SUMS to verify the integrity of downloaded files.

Downloads

The source package obnc contains the compiler with a build tool, a documentation generator and a small basic library of seven modules defined in The Oakwood Guidelines for Oberon-2 Compiler Developers. It also contains a (non-standard) library called ext which extends the basic library with modules for accessing command line arguments and environment variables, printing to the standard error stream, converting numbers to strings and vice versa, and for customizing the trap handler. The ext library was previously distributed as a separate package but has now been included in the main package for convenience.

obnc_0.17.1.tar.gz (226 KB)

Obnc is implemented in C and should compile on any POSIX compatible operating system. To build obnc you also need the Boehm-Demers-Weiser garbage collector GC. Further instructions are included in the README file in the root directory of the package.

For MS Windows users there is also a pre-compiled version of OBNC with all dependencies included (GC, SDL, Gawk and TCC):

obnc_0.17.1_win32.zip (2.3 MB)

Note: Output files generated by OBNC version 0.15 or earlier are not compatible with OBNC 0.17. If you have used a previous version, your modules need to be recompiled; simply delete the generated .obnc directory in your module directories before using the new version.

Text editor extensions

To make editing of Oberon source files more pleasant I have created a language mode for the text editor Gedit which provides syntax highlighting, and also a plugin which automatically converts reserved and predefined words from lowercase to uppercase as you type them. These extensions are also compatible with the text editor Pluma which is a fork of Gedit that has a more traditional look.

gtksourceview-oberon_1.0.0.zip (18.9 KB)
gedit-convertwords_1.0.0.zip (16.7 KB)

Documentation

Oberon:

OBNC Commands:

OBNC – Frequently Asked Questions (FAQ)

Articles

Books

Object-Oriented Programming in Oberon-2 (PDF, 1.4 MB) by Hanspeter Mössenböck
Oberon-2 has language support for type-bound procedures (methods), otherwise it is very similar to standard Oberon which OBNC targets (the article Data abstraction in Oberon describes how classes are implemented in standard Oberon).

Contact

If you have found an error or have suggestions for improvements you can contact karl@miasap.se. Questions about Oberon can be posted on Stack Overflow or in the Oberon mailing list at ETHZ. There is also the Usenet newsgroup comp.lang.oberon (which requires a Usenet account and a Usenet newsreader, for instance Mozilla Thunderbird).