The ModulaTor logo 7KB

The ModulaTor

Oberon-2 and Modula-2 Technical Publication

Erlangen's First Independent Modula_2 Journal! Nr. 8, Sep-1994

Oberon - A Rightsized Programming Language

by Guenter Dotzel

Most commonly used languages do not allow to do proper error checking, which is due to language design deficiencies.

To be competitive in todays and tomorrows software industry it is mandatory to use a high-level language where the compiler is able to find as many errors as possible. This requirement must be a language design goal.

The other requirement is simplicity. This allows to easily memorize the language's syntax and semantics without the need to look up any manual. This is only possible if the limit for the language report is 20 pages, including examples. The syntax shall fit on one page These limits keep the compiler simple, allow efficient translation and to construct reliable compilers within reasonable time for a variety of platforms.

Oberon-2 is the best example of an object-oriented language in the Pascal/Modula-2 tradition which fulfills the above requirements (see Oberon-2 LALR Syntax below) and there are many good books about Oberon-2:

Hanspeter M~ossenb~ock: Object-Oriented Programmierung in Oberon-2. Springer Verlag, 1993. Also avalaible in German.

Martin Reiser, Niklaus Wirth: Programming in Oberon. Addison Wesley, 1992. Also avalaible in German.

Juerg Gutknecht, Niklaus Wirth: Project Oberon, Addison Wesley, 1992.

Recommended reading for those interested in a language comparison of Oberon vs. C++ in respect to features, ambiguities, complexity, portability, safety and functionality:

Josef Templ, Email:, published a good article in the German Unix magazin iX, Sep-94, p138..p143 entitled Comparison of the Programming Languages Oberon and C++ (English version)

AXP Oberon-2 Product News:

Now, only six weeks after the launch of
MaX, ModulaWare's AXP/OpenVMS Modula-2 compiler,
A2O, ModulaWare's AXP/OpenVMS Oberon-2 compiler is now nearly ready too!

We'll present both compilers at the Joint Modular Language Conference JMLC-94, 28/30-Sep-94 at University Ulm/Germany.

In addition to the features of H2O (ModulaWare's VAX/VMS Oberon-2), A2O has 64 bit record keys and type descriptors pointers. This allows easy migration to 64 bit addressing as soon as Digital has extended the virtual address space of OpenVMS processes (scheduled for 1995).

Also, the Storage module (implicitely imported when you use NEW in Oberon) and the record type registration for persistent objects, module Objects_Types is now better integrated and due to compatible calling conventions for "variable record parameters", M2 and O2 programs can now more easily be combined in one project on AXP.

Further information see:
MaX data sheet
A2O data sheet
MaX/A2O implementation notes


Dick Pountain, Email:, wrote an article entitled A Different Kind of RISC, in BYTE, Aug-94 p185.

He said that HP's PA-RISC 7200 likely to hold the "fastest RISC in town" title for immediate future and that PA 7200 is "expected" to top 175 specintfp, 250 specfp92.

DEC Alpha AXP 21064 (DEC 3000 AXP 900 deskside 275 MHz) delivers 189 specint92, 264 specfp92 today.

Telling from my experience as a compiler writer, AXP's potential in scalability and parallelism is clearly better than with HP's PA architecture.

Apart from the fact that the AXP is full 64 bit, available today and faster.

Oberon-2 Conferences & Tutorials

This year's "Oberon Day" is at ETH Zuerich/Switzerland, in 14-Sep-1994.

Main topics are Computer Science Education, Visual Programming with Gadgets, Magic Oberon or How To Teach the Unteachable (by Prof. Gutknecht).

Further events you should not miss:

21/22-Sep-1994: Tutorial at ETHZ: "Programming with Oberon" by Michael Franz.

23-Sep-1994: Tutorial at ETHZ: "Extensible Programming with Oberon" by Michael Franz. Contact Ms. M. Bernard at ETHZ: fax +41 1 632 1172 or Email

28/30-Sep-1994: JMLC-94 Ulm/Germany. Contact or fax ++49 731 502 4142

Key to portable software

Those not working with PCs might have time to read a fresh book:

Michael Franz's PhD is now available. His new book is entitled

"Code-Generation on-the-fly: A Key to Portable Software",

published by VdF-Verlag, Zuerich, 1994, ISBN 3-7281-2115-0, about 100 pages, costs about DM 60.- here in Germany.

He describes a portable, processor independent, efficient, intermediate code representation technique suitable for fast generation of the target processor code during link/load.

This technique is not Oberon specific but it was first used in combination with Oberon-2 compilers running under the Oberon System.

Other Oberon books published by VdF-Zuerich are

C.A. Szypersky's "Insight ETHOS, on object orientation in operating systems", describes an OS written in Oberon-2; about 232 pages; costs DM 57.-

M. Odersky: "A new approach to formal language definition and its application to Oberon"; about 160 pages; costs DM 40.-

All books are written in English. They are difficult to get, especially in the US. If you have problems getting these books, please contact ModulaWare.

Oberon-2 LALR-Syntax

From: (Taylor Hutt)

Goal -> Module <eof> 

Module -> MODULE <ident> ';' [ImportList] DeclSequence [BEGIN StatementSequence] END {ModuleName} '.' 

ImportList -> IMPORT Import\';'... ';' 

Import -> <ident> [':=' <ident>] 

DeclSequence -> [CONST [ConstantDecl ';']... | TYPE [TypeDecl ';']... | VAR [VariableDecl ';']...]... [ProcedureDecl ';' | 
 ForwardDecl ';']... 

ProcedureDecl -> ProcedureHeading ';' ProcedureBody <ident> ';' 

ProcedureHeading -> PROCEDURE ['*'] IdentDef [FormalParameters] 

ProcedureBody -> DeclSequence [BEGIN StatementSequence] END 

ForwardDecl -> PROCEDURE '^' IdentDef [FormalParameters] 

FormalParameters -> '(' [FPSection [';' FPSection]...] ')' [':' QualIdent] 

FPSection -> [VAR] <ident>\','... ':' FormalType 

FormalType -> [ARRAY OF]... (QualIdent | ProcedureType) 

IdentDef -> <ident> ['*'] 

QualIdent -> [{ModuleName} '.'] <ident> 

ConstantDecl -> IdentDef '=' ConstantExpression 

ConstantExpression -> Expression 

TypeDecl -> IdentDef '=' Type 

Type -> QualIdent -> ArrayType -> RecordType -> PointerType -> ProcedureType 

ArrayType -> ARRAY Length\','... OF Type 

Length -> ConstantExpression 

RecordType -> RECORD ['(' BaseType ')'] FieldList\';'... END 

BaseType -> QualIdent 

FieldList -> [IdentList ':' Type] 

IdentList -> IdentDef\','... 

PointerType -> POINTER TO Type 

ProcedureType -> PROCEDURE [FormalParameters] 

VariableDecl -> IdentList ':' Type 

Designator -> QualIdent [ '.' <ident>... | '[' ExpList ']' | '(' QualIdent ')' | '^']... 

ExpList -> Expression\','... 

Expression -> SimpleExpression [Relation SimpleExpression]... 

Relation -> ('=' | '#' | '<' | '<=' | '>' | '>=' | IN | IS) 

SimpleExpression -> ['+' | '-'] Term [AddOperator Term]... 

AddOperator -> ('+' | '-' | OR) 

Term -> Factor [MulOperator Factor]... 

MulOperator -> ('*' | '/' | DIV | MOD | '&') 

Factor -> <number> -> <charconst> -> <string> -> NIL -> Set -> Designator [ActualParameters] -> '(' Expression ')' -> ' ' 

Set -> '{' Element\','... '}' 

Element -> Expression ['..' Expression] 

ActualParameters -> '(' [ExpList] ')' 

StatementSequence -> Statement\';'... 

Statement -> [ Assignment | ProcedureCall | IfStatement | CaseStatement | WhileStatement | RepeatStatement | 
 LoopStatement | WithStatement | EXIT | RETURN [Expression]] 

Assignment -> Designator ':=' Expression 

ProcedureCall -> Designator [ActualParameters] 

IfStatement -> IF Expression THEN StatementSequence [ELSIF Expression THEN StatementSequence] [ELSE 
 StatementSequence] END 

CaseStatement -> CASE Expression OF Case\'|'... [ELSE StatementSequence] END 

Case -> [CaseLabelList ':' StatementSequence] 

CaseLabelList -> CaseLabels\','... 

CaseLabels -> ConstantExpression ['..' ConstantExpression] 

WhileStatement -> WHILE Expression DO StatementSequence END 

RepeatStatement -> REPEAT StatementSequence UNTIL Expression 

LoopStatement -> LOOP StatementSequence END 

WithStatement -> WITH QualIdent ':' QualIdent DO StatementSequence END 

Modula-2 vs. C

(C) 1994 Stein Jorgen Ryan

From: (Stein J\277rgen Ryan)
Newsgroups: comp.lang.modula2
Subject: Re: Introduction to Modula-2
Message-ID: <32n5v5$>
Date: 15 Aug 1994 09:37:09 +0200
References: <>
Organization: Dept. of Informatics, University of Oslo, Norway

I have written several commercial applications. The source code for most of these systems is of more than toy size (above 30.000 lines). All of the systems are for the IBM PC running MS DOS and Windows.

Some of them were written entirely in C, and some entirely in Modula-2. When comparing my efforts, writing in C seems like going back to the stone age. The ONLY reason I code in C is because that's the only thing you can use if you want to write stuff which can be ported between the Microsoft Windows platforms.

In my opinion, the greatest problems with C are:

1. An incredibly weak syntax which effectively lobotomizes the compiler. The classic is using = instead of == or vice versa. There is no excuse for this sick language design. Saying that the programmer must "know what he is doing" is stupid at best. Programmers make mistakes. The compiler should help catching them. Especially when it is so simple (use := and = instead of = and ==).

2. No module concept. Some people think that header files solve this. They seem think that INCLUDE is just as good as IMPORT. That's when you start suspecting that they have probably never written a real world system. The IMPORT of Modula-2 makes it possible for the compiler system to figure out the inter-module dependencies. So the compiler system can figure out what to rebuild when building an application. With C you have to use another concept from the stone age: MAKE files (the original article describing MAKE is dated 1978). This is a completely ridiculous design which makes it very hard to maintain large programs.

3. In C, every expression is considered a statement. This is not sane, and explains why the compiler can not catch wrong use of == and =.

I find that I have A LOT MORE BUGS when I write in C than in Modula-2. Most of them are stupid ones that would have been caught by a M2 compiler because of the stronger syntax of M2. Many of them are also related to the problem of maintaining the inter-module dependencies in the make files. Sometimes I find myself sweating over a bug that mysteriously disappears when I do a "make all". Sweating over non-existentbugs is not acceptable in a commercial environment where time is money.

To sum it all up, the only sane reason to use C would be because it is the most portable thing available on all platforms. I think that software production today is incredibly inefficient. We are basicly using the same tools today as we did 20 years ago. Drawing on my own experience, I claim that software can be produced much more efficiently in other languages that have better support for programming in the large. I think the problem is that programmer efficiency is seldomly evaluated.

I would like to hear rational arguments for using C. Preferably from people with experience in writing commercial systems that realize the value of high productivity in their programmer staff.

Stein J. Ryan, PhD student, University of Oslo

[ed. note: permission for publication in The ModulaTor was granted by the author in 23-Aug-1994.]

The ModulaTor Forum

Women and Tetris addiction

Date: Fri, 10 Jun 1994 19:05:16 -0700
From: Hilarie Orman <>
Subject: Re: Women and Tetris addiction

"Copyright (C) 1994 Hilarie Orman".

There are indeed deep psychological forces that draw women to the game of Tetris. I've been a Tetris junky, and I can give my testament to the risks of this particular addiction. First, I admit that I am, by nature, susceptible. I've been through several 12 step programs to rid myself of addictions in the past: adventure, pacman, rogue, hack. Yes, I've been there, and in several other autotelic hells as well: elisp, C++, interrupt handler bugs, and more recently I've been developing a WWW browsing problem. It started in childhood with a Revell model of a "car of the future" (lime-green with huge tailfins and clear bubbles over the occupants in their bucket seats) and continued with more plastic cars, battleships, airplanes, then those chests of little steel girders, then calligraphy, ..., OK, OK, I'm autotelic, I'm a woman, and I'm going to tell my Tetris tale.

First, let me establish my credentials as a Tetris hard-core. I found it while on vacation in Maui. I dragged my family in our Aloha clothing to a video games den every evening after we cleaned up from a day on the beach. The clientele was young, local, kind of tough. Ordinarily I'd feel uncomfortable spending 5 minutes in such a place. But with a stack of quarters and a Tetris machine, I was transported. The locals would sit behind me sneering and asking if they could "PLEASE" use the machines. At first, I'd let them.

But things changed when we got back home to Los Angeles. I found a video parlor in Marina Del Rey with Tetris. The clientele was even more disturbing, but again, the game presented a world of its own. One afternoon, a woman with two small children attempted to take the machine away from me. While I was concentrating on the play, she informed me that her kids wanted to use the machine. Without looking up, I told her that I'd only yield if it was management policy to impose a time limit. After a moment of shock she began screaming insults at me and dragged the children away. Though I didn't ever look up to see what kind of person she was, it did pretty much ruin my timing for that level. I got busy with various home and work projects shortly after that, and I haven't played much since.

For a while I tried using xtetris on my workstation, but it wasn't the same. And I've never actually used a GameBoy, because it's hard to get the little kids to share them, and even if they do they won't let you play for more than a few minutes before they start whining. So I'm going to talk only about my experiences with the big machines in the video arcades.

So what is it exactly that draws women to Tetris? I think it's refrigerators. At first I thought it was cabinets, but I've been over this in my mind a lot, and I'm convinced that refrigerators are the key. The sociologist who mentioned women's "craving for order" seemed way off base, she'd obviously never been within a mile of a teenage girl's room, but still, that's the key to it. Women spend a lot of time trying to get things into refrigerators. The point is, they don't have a natural sense of order, but they've got to get the damn stuff into the fridge so it doesn't fall out, and that requires ingenuity. Cabinets are similar, but they use different reasoning skills than refrigerators. For example, it's OK to push something to the back of a cabinet and lose it for a year. And things that go into cabinets nest --- you've got to be careful with those graduated bowls if they're from different sets, because if you put one inside the other you'll need a screwdriver and pliers to get it out.

Now refrigerators and Tetris are much the same thing. The Tetris shapes are like Tupperware boxes and milk cartons and packages of cheese. But unlike real household items, they remain sparkling and attractive no matter how long you leave them there. And if you pack them very carefully along the bottom, instead of rotting and giving off foul odors, they are conveniently whisked away, while more continue falling. This is sort of like having your husband help unload the groceries --- there you are trying to get the vegetables packed carefully into the bottom bins, and there he is stuffing soft drink cans into the dairy products section.

As you move through the various difficulty levels of Tetris, it's even more like a refrigerator --- you don't get to start with a clean space, but instead have what looks like piles of debris from unknown previous users. Women know that these unseen entities are teenagers and you've got to be very resourceful and controlled to work around them.

But what's the payoff in this contest? Well, mainly it's being able to exercise a skill that women already have, but with lots more positive feedback than real life. And for me, the video arcade games have two really important features. One is a cute little Slavic dance tune that plays in the background and helps with the timing. But the real clincher is that as you get proceed through the difficulty levels, there's entertainment. Little Russian men come out onto the screen and dance in that style where they fold their arms and bend their knees and kick straight out. Yes, that's the real thing about Tetris for some of us older ladies, it's the dancing men. In all my years of cleaning out the refrigerator, I've never had a man dance a jig for me. Well, that's why I play Tetris; I'm not sure about anyone else.

[Ed. note: Permission for publication of this article in The ModulaTor was granted by the autor in Mon, 4 Jul 1994 13:46:29 -0700.]

Sung to Beatles "Let it Be"

 Massimo .Vilas. Villa enlightens us with:
 From: (Massimo .Vilas. Villa)
 Date: Mon, 20 Jun 1994 15:54:00 +0000
 Subject: joke

When I find my code in tons of trouble, Friends and colleagues come to me, Speaking words of wisdom: Write in C.

As the deadline fast approaches, And bugs are all that I can see, Somewhere, someone whispers: Write in C.

Write in C, write in C, Write in C, oh, write in C. LISP is dead and buried, Write in C.

I used to write a lot of FORTRAN, For science it worked flawlessly. Try using it for graphics! Write in C.

If you've just spent nearly 30 hours Debugging some assembly, Soon you will be glad to Write in C.

Write in C, write in C, Write in C, yeah, write in C. Only wimps use BASIC. Write in C.

Write in C, write in C Write in C, oh, write in C. Pascal won't quite cut it. Write in C.

{ Guitar Solo }

Write in C, write in C, Write in C, yeah, write in C. Don't even mention COBOL. Write in C.

And when the screen is fuzzy, And the editor is bugging me. I'm sick of ones and zeros, Write in C.

A thousand people swear that T.P. Seven is the one for me. I hate the word PROCEDURE, Write in C.

Write in C, write in C, Write in C, yeah, write in C. PL1 is 80s, Write in C.

Write in C, write in C, Write in C, yeah, write in C. The government loves ADA, Write in C.

IMPRESSUM: The ModulaTor is an unrefereed journal. Technical papers are to be taken as working papers and personal rather than organizational statements. Items are printed at the discretion of the Editor based upon his judgement on the interest and relevancy to the readership. Letters, announcements, and other items of professional interest are selected on the same basis. Office of publication: The Editor of The ModulaTor is Guenter Dotzel; he can be reached by tel/fax: [removed due to abuse] or by mailto:[email deleted due to spam]

Home Site_index Contact Legal Buy_products OpenVMS_compiler Alpha_Oberon_System DOS_compiler ModulaTor Bibliography Oberon[-2]_links Modula-2_links [3KB] [Any browser]

Webdesign by, 14-Nov-1998