(Note followups to poster...)
Which Oberon-2 doesn't support (and C, C++ and most other languages
don't support either, of course).
Other things:
Strings can't contain quote marks (no 'escape' like backslash). It
isn't clear from the specification whether they can contain
non-printing characters like tab and newline.
No unsigned types (implicit 2's-complement arithmetic?). No bit
operators except (sort of) in SYSTEM.
Even less specification of sizes of integer types than in C90 (as far
as I can see everything from LONGREAL to SHORTINT could be a single
bit!).
Files? I/O in general?
No, this is a quite common misconception that is probably one of the
reasons the language isn't more widespread than it is. Oberon/Oberon-2
is not merely a teaching language. It was used to build an entire
operating system, namely Oberon.
I wonder how, I see nothing in the specification:
http://www.zel.org/aos/o2report.htm
which even mentions input or output in any standard way. SYSTEM defines
procedures for accessing 'memory' directly, but nothing to access I/O
(not all I/O is memory-mapped!). Presumably all of the "nasty bits" are
written in C or assembler and then linked in (in some unspecified way).
(All other copies of the specification seem to be variants of the one I
quoted.)
In Oberon-2 you isolate the potentially
dangerous low level code in so called SYSTEM modules. If you import the
SYSTEM pseudo module you can do *anything*. I recommend reading Stefan
Metzeler's article at
http://www.amadeus-3.com/main_files/oberon2vsCPP.php (although he is
biased in favour of the product he sells, he has some good points).
He's very biased against C and C++, certainly. His Deutsche Bank
example is just stupid, why they bothered to use C++ at all I don't
understand and that sort of draconian limitation is certainly not
necessary to writing safe and maintainable C or C++ programs. Similarly
with his Microsoft example, the fact that MS write unsafe code is
nothing to do with using C++, it's because (a) they have to try to keep
backwards compatibility with systems which were never designed for
security (right back to MSDOS!) and (b) because they have a design goal
of "more features" (and especially flashy ones).
His rant against C++ boils down to "I don't like C++" and "I like
Oberon-2". Some of his statements are just plain wrong (his section on
"local procedures", with the idea of putting a for loop into a local
procedure to declare the loop variable -- huh? Either he means a local
block, which C and C++ have, or he's really confused).
And what on earth is this term 'accolades' used for braces (squiggly
brackets, {})? The dictionary definition of 'accolade' is "An
expression of approval; praise. A ceremonial embrace, as of greeting or
salutation. Ceremonial bestowal of knighthood." (American Heritage
Dictionary, via
http://dictionary.reference.com/). He uses the (spit!)
K&R style as an example of how difficult it is to line them up, ignoring
styles which make it easy to do so.
Chris C