home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / modula2 / 1384 < prev    next >
Encoding:
Internet Message Format  |  1992-11-14  |  5.5 KB

  1. Path: sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!elroy.jpl.nasa.gov!usc!zaphod.mps.ohio-state.edu!uwm.edu!linac!att!ucbvax!MAIL.CASI.NASA.GOV!thutt
  2. From: thutt@MAIL.CASI.NASA.GOV (thutt)
  3. Newsgroups: comp.lang.modula2
  4. Subject: Oberon-2 discussion continues
  5. Message-ID: <9211130912.A01822@MAIL.CASI.NASA.GOV>
  6. Date: 13 Nov 92 14:12:24 GMT
  7. Sender: usenet@ucbvax.BERKELEY.EDU
  8. Reply-To: Modula2 List <INFO-M2%UCF1VM.BITNET@uga.cc.uga.edu>
  9. Organization: The Internet
  10. Lines: 105
  11.  
  12.  
  13.   The discussion of Oberon continues....
  14.  
  15.   Markku Sakkinen continues the discussion of enumerations started by
  16.   me (thutt):
  17.   >In article <5897@balrog.ctron.com> smith@ctron.com writes:
  18.   >>In article <9211091022.A01745@MAIL.CASI.NASA.GOV>, thutt@MAIL.CASI.NASA.GOV
  19.   > (thutt) writes:
  20.   >> I wouldn't classify enumerations as "superfluous", their removal is a
  21.   >> real loss.  But I think the real reason they went was because they
  22.   >> are so difficult to type-extend.  Type-extension is Oberon's "thing",
  23.   >> and it would be most difficult to set up a mechanism wereby various
  24.   >> enumerations were derived from previously-defined enumerations, where
  25.   >> certain identifiers are valid for all, but not all identifiers are.
  26.  
  27.   > That has obviously been the main reason for eliminating enumerations.
  28.   > And even this rationale is very weak.  Only record types can be extended
  29.   > in Oberon, not atomic types nor arrays.
  30.  
  31.   The ability to extend enumerations did play a role in their demise,
  32.   however it was of a limited role.  (For the record, enumeration
  33.   extension has been implemented at ETH but removed (according to one
  34.   person in ETH involved in the Oberon compilers)).
  35.  
  36.   To see, rationally, why enumerations were removed, we must ask
  37.   ourselves, of what use is an enumeration?  Well, they are good for
  38.   enumerating items, and allowing good type checking.
  39.  
  40.   It turned out, according to ETH, that enumerations were filling this
  41.   goal, but they were also filling up a program with unecessary types
  42.   and identifiers.  This eventually detracted from a program's
  43.   readability.
  44.  
  45.   Several key features of Oberon also make enumerations less valuable.
  46.   For example, (as someone pointed out), enumerations are often used to
  47.   discrimnate variants in records.  Oberon's record extension and type
  48.   testing disolve the need for this capability.
  49.  
  50.   Using the module concept, and encapsulating your procedure parameters
  51.   as `messages' to the data structure obviates the need to have
  52.   enumerated parameters to a function.
  53.  
  54.   If you must enumerate something (mouse buttons, for example), and
  55.   your program is well designed (modularized), there is no reason why a
  56.   constant cannot be used in the place of an enumeration.  If you doubt
  57.   this, take a look at the source for the Oberon project
  58.   (neptune.ethz.ch, directory /Oberon/???)
  59.  
  60.   >>> c) generic SET OF: Since there is no enumeration, what are you to make
  61.   >> This was Wirth not going far enough.  Without enumerations, sets
  62.   >> really have little utility or expressiveness over bit-pushing
  63.   >> operators like C's.  SETS could have been axed in favor of a slight
  64.   >> extension of the INTEGER type.
  65.   > I don't agree, especially since C has not got bit arrays. But set
  66.   > types have always been sadly crippled in Wirth's languages:  Pascal
  67.   > implementers are not required to support even the the full CHAR type
  68.   > as the base type for SET OF CHAR, not to speak of true SET OF
  69.   > INTEGER.  Fully-fledged set types could often be useful abstractions
  70.   > in programming.
  71.  
  72.   There you go again.  It seems that many of the people who are
  73.   complaining about Oberon are not focused on the goal.  Without trying
  74.   to start an RWAR & keeping in mind the `Make it as simple as
  75.   possible, but no simpler' adage used in the Oberon project, your call
  76.   for a SET OF n is unfounded.
  77.  
  78.   The goal of Oberon was to reduce the features in a language that are
  79.   _strictly_ unneccessary.  Couple this with the performance hit of a
  80.   generic set (runtime & compiler complexity), and you can see that it
  81.   is not worth the effort.  By adding features to a language in a
  82.   haphazard manner, you will end up with C++, or something like
  83.   Modula-3.
  84.  
  85.   >>>  e) DEFINITION & IMPLEMENTATION merged.
  86.  
  87.   >>This was a really bad move.  Now you can't define the interface separately
  88.   >>and enforce it, and the "*" and "-" stuff is really kludgy, very atypical
  89.   >>of Wirth's work.  Even if you accept that merging the def and imp is good,
  90.   >>interface details like READONLY really deserve their own keywords.
  91.  
  92.   No, this is a good move.  The maintenance of only 1 file is a big
  93.   win.  If you are concerned about the definition being published with
  94.   the source, don't worry.  There is a `Browser' module which will
  95.   output a definition for a compiled module.  You can then ship the
  96.   defintion (sans comments, unless you provide them) with your object
  97.   modules.
  98.  
  99.  
  100.   Larry Smith points out:
  101.   >> d) FOR statement removed in Oberon.  It is reinstated in Oberon-2.
  102.   > Wirth discovered that counting loops really are a primitive construct.
  103.  
  104.   Counting loops are indeed primitive.  That is what LOOP, REPEAT and
  105.   WHILE accomplish.  I think the FOR loop was readded as syntactic
  106.   convenience.  They should have made the FOR loop more like ADA, that
  107.   is, with a _true_ induction variable.
  108.  
  109.   He also points out that it is the best language to be found.  Agreed.
  110.   Exception handling would be nice, but is not _strictly_ needed.
  111.  
  112.   Incidentally, ASSERT is now a standard procedure in Oberon.
  113.  
  114.   Taylor
  115.   thutt@mail.casi.nasa.gov
  116.   Championing worldwide usage of Oberon-2
  117.