Post by RebusToday, some of
my colleagues question the need for the strict type
system of languages like Modula-2. More popular
languages of today tend to be weak typed, such that
adding an integer variable and a float variable without
explicit conversion is permitted, for example. Why not
allow this they ask? Ah, well.
Immediately after Modula-2, Wirth did follow this sort approach in his
language Oberon:
"With the proliferation of basic types, a relaxation of compatibility rules
among them becomes almost mandatory. (Note that in Modula the numeric types
INTEGER, CARDINAL, and REAL are incompatible). To this end, the notion of
type inclusion is introduced: a type T includes a type T', if the values of
type T' are also values of type T. Oberon postulates the following
hierarchy:
LONGREAL > REAL > LONGINT > INTEGER > SHORTINT"
('From Modula to Oberon', N. Wirth, 1990)
However, in the recent revisions (2007 and 2011) of Oberon he has reverted
back to requiring explicit conversion functions (e.g. FLT and FLOOR) to do
the conversions.
Generally I prefer to be able to tell the compiler exactly what I want it to
do - not rely on it to second-guess what I might be trying to do. Also I
want to know *as soon as possible* when I have done something which is
potentially stupid. e.g. while I am compiling a program, not when a user on
the other side of the world is running the program!
Regards,
Chris Burrows
CFB Software
Astrobe: ARM Oberon Development System
http://www.astrobe.com