home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / modula2 / 1381 < prev    next >
Encoding:
Text File  |  1992-11-13  |  5.9 KB  |  117 lines

  1. Newsgroups: comp.lang.modula2
  2. Path: sparky!uunet!mcsun!Germany.EU.net!ira.uka.de!news.belwue.de!theorie!titania.mathematik.uni-ulm.de!borchert
  3. From: borchert@titania.mathematik.uni-ulm.de (Andreas Borchert)
  4. Subject: Oberon vs Modula-2 (Re: mail delivery error)
  5. Message-ID: <1992Nov13.100154.6167@informatik.uni-ulm.de>
  6. Sender: usenet@informatik.uni-ulm.de (Name for nntp-posting)
  7. Nntp-Posting-Host: titania.mathematik.uni-ulm.de
  8. Organization: University of Ulm, SAI
  9. References: <9211091022.A01745@MAIL.CASI.NASA.GOV> <5897@balrog.ctron.com> <1992Nov11.102409.12183@jyu.fi>
  10. Date: Fri, 13 Nov 92 10:01:54 GMT
  11. Lines: 104
  12.  
  13. In article <1992Nov11.102409.12183@jyu.fi>, sakkinen@jyu.fi (Markku Sakkinen) writes:
  14. > In article <5897@balrog.ctron.com> smith@ctron.com writes:
  15. > >In article <9211091022.A01745@MAIL.CASI.NASA.GOV>, thutt@MAIL.CASI.NASA.GOV (thutt) writes:
  16. > >> ...
  17. > >I wouldn't classify enumerations as "superfluous", their removal is a real
  18. > >loss.  But I think the real reason they went was because they are so difficult
  19. > >to type-extend.  Type-extension is Oberon's "thing", and it would be most
  20. > >difficult to set up a mechanism wereby various enumerations were derived from
  21. > >previously-defined enumerations, where certain identifiers are valid for all,
  22. > >but not all identifiers are.
  23. > That has obviously been the main reason for eliminating enumerations.
  24. > And even this rationale is very weak.  Only record types can be extended
  25. > in Oberon, not atomic types nor arrays.
  26.  
  27. Extending atomic types or arrays is completely different from extending
  28. records which usually represent abstractions. Records are sufficient
  29. and the implementation of record extensions is straightforward and efficient.
  30.  
  31. The main problem is to assure extensibility of existing software. This
  32. is done in Oberon by extending given abstractions to your problem which
  33. allows your new data types to be processed by software written earlier.
  34.  
  35. In some cases enumeration types tend to prohibit extensibility if they
  36. are exported. Nevertheless, it would be possible to include them
  37. in Oberon in Modula-2 manner without great trouble.
  38.  
  39. Possible extensions of arrays and atomic types would like other
  40. features (e.g. exceptions or whatever) make life more difficult: for
  41. the language designer, the compiler constructor and, of course, the
  42. programmer which would have to read a 600-pages Modula-Standard style
  43. manual. Don't forget that Oberon still needs less than 20 pages of
  44. language description.
  45.  
  46. As long as it is possible to formulate problems in a elegant manner in
  47. Oberon we don't need to blow up the language. Try to view your libraries
  48. itself as extensions of the language and you get all what you need:
  49. extensible arithmetic data types, exceptions (which need coroutines
  50. of course, but at least my implementation has them) or whatever.
  51.  
  52. Don't forget, Wirth's primary design goal was: "Make it as simple as
  53. possible. But not simpler."
  54.  
  55. > >>      c) generic SET OF: Since there is no enumeration, what are you to make
  56. > >>      a set from?  The SET type is now equivalent to the M-2 BITSET. It is of
  57. > >>      an implementation dependant size (usually at least 32 bits).
  58. > >
  59. > >This was Wirth not going far enough.  Without enumerations, sets really have
  60. > >little utility or expressiveness over bit-pushing operators like C's.  SETS
  61. > >could have been axed in favor of a slight extension of the INTEGER type.
  62. > I don't agree, especially since C has not got bit arrays.
  63. > But set types have always been sadly crippled in
  64. > Wirth's languages:  Pascal implementers are not required to support
  65. > even the the full CHAR type as the base type for SET OF CHAR,
  66. > not to speak of true SET OF INTEGER.  Fully-fledged set types could often
  67. > be useful abstractions in programming.
  68.  
  69. Wirth's aim was always to avoid putting algorithms into the language
  70. which could be expressed by the language itself. Having a basic set type,
  71. you are able to build up arbitrary set types which work efficiently.
  72.  
  73. > >>      e) DEFINITION & IMPLEMENTATION merged.  Exported identifiers are
  74. > >>      marked with a *.  Read-only exported variables are marked with a -.
  75. > >>      Let us hope they make a read-only VAR parameter, which would be
  76. > >>      useful for exported procedures that take a VAR parm for efficiency.
  77. > >>      The programmer using the procedure would be guaranteed that the
  78. > >>      parameter is not modified!
  79.  
  80. VAR-parameters which are readonly for efficiency purposes doesn't make
  81. much sense because this is a problem of code optimization. Requests
  82. like this could be easily extended to the horrible register declarations
  83. of C!
  84.  
  85. I agree with all people which prefer the separation of DEFINITION and
  86. MODULE. The first version of Oberon as published in Software Practice
  87. and Experience was still separated and I still prefer this version
  88. in comparison to all later versions (with the exception of some
  89. syntactical clean ups).
  90.  
  91. > I have read somewhere that the parameter modes were variable vs. constant
  92. > in an early version of Pascal.  That would have been much better
  93. > than the current by-value vs. by-reference distinction (which should be left
  94. > as an implementation issue)!
  95.  
  96. The choice between by-value and by-reference as an implementation issue? 
  97. Sounds not reasonable -- probably I've missed your point.
  98.  
  99. > >This was a really bad move.  Now you can't define the interface separately
  100. > >and enforce it, and the "*" and "-" stuff is really kludgy, very atypical
  101. > >of Wirth's work.  Even if you accept that merging the def and imp is good,
  102. > >interface details like READONLY really deserve their own keywords.
  103. > Field-width denoters in the calls of the READ and WRITE quasi-procedures
  104. > of Pascal spring to mind as a worse syntactic kludge, but it is
  105. > nevertheless atypical.
  106.  
  107. I agree. Programs should be readable but not cryptical.
  108.  
  109. -- 
  110. _______________________________________________________________________________
  111.  
  112. Andreas Borchert, University of Ulm, SAI, D-W-7900 Ulm, Germany
  113. Internet: borchert@mathematik.uni-ulm.de
  114.