Quote:
Originally Posted by Sergei Steshenko
Wise. By the way, IIRC, Modula-2 System module is dangerous - intentionally and by design - which makes Modula-2 a universal language, i.e. one can also program hardware in it.
And beginners are simply forbidden to use the module.
|
you won't even need SYSTEM for that. If, on a DOS style machine, you define a byte as a bitset you can manipulate individual bits in memory. Fast screen writes were usually done by having a big array at the address of the VGA screen buffer.
On Linux systems, the SYSTEM module is not dangerous at all. You will need root privileges for special things.
In general, Modula-2 is safe because it
won't let you do pointer arithmetic
won't allow math with different TYPE's
is VERY picky about procedures that return something
has no (real) goto / label construct
has definite END clauses for each IF
wants to be a MINIMAL system, whereas C, Java, C++ etc strive to be complete
implements code hiding and reuse
allows overloading in a SAFE way
does not require complex MAKE files
among many other things. Furthermoe, the compiler is there to help you, not to fight you.
A warning from my side:
IF youKnowModula2 = TRUE THEN
LearningJava := Troublesome ()
ELSE
LearningJava := Problematic ()
END
Java is more TYPEsafe than the other C-ish languages. But it suffers from the same amount of onamentation. Zillions of libraries just to be compelte for all persons in all places on all planets.
For GUI-ish programs I try to make a mix of Tcl/Tk front ends, which float on top of Modula-2 compiled executables.