Programming in the Large

Programming languages like Ada and C++ have many features to try make it feasible for teams to write large systems. Oberon relies heavily on the MODULE construct for this, and more importantly on a culture of avoiding large systems where possible. Here are collected some small pieces of software that I found useful for development in the Oberon environment.

Files often contain two modules, one for the implementation and one for a unit test. I owe this to examples on the Astrobe forums.

Debug Output

The first thing is a simple debug output library. PO2013 doesn't have an interactive source-level debugger (I don't find these very useful anyway). The book mentions a backtrace feature on traps, but I can't find that. This code is similar to the C technique of sprinkling printfs around, with the following small improvements:

Finite State Machines

Secondly, I wrote some code to implement finite state machines. It may be a matter of taste, but I prefer to structure software as cooperating FSMs when possible.

Testing

Finally, I wrote a unit testing library that should play nice with DejaGNU. Note that this is one of the few files that are in Oberon-2, since it was originally intended to run on UNIX. This is also why the production and test code are in separate files, I think this is a limitation of voc. Unfortunately, DejaGnu itself seems unreliable on Windows so I just use the library on its own for now even though it doesn't add as much value.