home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / acorn / tech / 60 < prev    next >
Encoding:
Internet Message Format  |  1992-08-17  |  5.2 KB

  1. From: kers@hplb.hpl.hp.com (Chris Dollin)
  2. Date: Tue, 18 Aug 1992 08:02:46 GMT
  3. Subject: Re: New Language/Compiler (ideas wanted)
  4. Message-ID: <KERS.92Aug18090246@cdollin.hpl.hp.com>
  5. Organization: Hewlett-Packard Laboratories, Bristol, UK.
  6. Path: sparky!uunet!munnari.oz.au!mips!mips!sdd.hp.com!hpscdc!hplextra!otter.hpl.hp.com!hpltoad!cdollin!kers
  7. Newsgroups: comp.sys.acorn.tech
  8. References: <1195@grun.is> <1992Aug17.132929.10141@waikato.ac.nz> <KERS.92Aug17083517@cdollin.hpl.hp.com> <1992Aug18.114418.10160@waikato.a
  9. Sender: news@hplb.hpl.hp.com (Usenet News Administrator)
  10. Lines: 112
  11. In-Reply-To: bwc@waikato.ac.nz's message of 18 Aug 92 11:44:18 +1200
  12. Nntp-Posting-Host: cdollin.hpl.hp.com
  13.  
  14. In article ... bwc@waikato.ac.nz (Ug!) writes [responding to me]:
  15.  
  16.    Beware: Lisp is essentially an interpreter, even when it's compiled.
  17.  
  18. Would you like to explain the grounds on which you base this claim? [What do
  19. you mean by ``essentially'' and ``interpreter''?]
  20.  
  21.    > Lisp. Scheme. Poplog Pop11. Smalltalk. Don't forget ratios and complexes.
  22.  
  23.    Oh I know.  But ratios and complexes can be added where needed.  They 
  24.    shouldn't be a 'standard part' of the language.  
  25.  
  26. I think the standard library *is* part of the language, and I'd rather have
  27. ratios and complexes than not.
  28.  
  29. I suggested user-defined operators. Ug! said:
  30.  
  31.    Hmm.  Perhaps.  The problem then is that you have to pake allowances for all
  32.    symbols and symbol combinations in the parser.  Tricky.  I'd go for
  33.    simplicity, and just allow the built in operators to be overloaded.
  34.  
  35. Tricky? *Tricky*? TRICKY?
  36.  
  37. ``Trivial'' is the word I'd use. Lexical analysers clump up letters into
  38. identifiers all the time; what's to stop them clumping up sign characters into
  39. operator names? There is *no* problem here, despite what C++ language designers
  40. may have tried to tell you. [They're stuck with supporting the lexis of C, and
  41. wimped out on requiring whitespace for utterances such as ``x+++y''.]
  42.  
  43. I said:
  44.  
  45.    > Lists. Sets. Hash tables (both content and address based).
  46.  
  47. Ug! said:
  48.  
  49.    Exactly.  All of these are implementable though.  
  50.  
  51. [Presumably he means on top of the language.] Yes, but see my remarks above
  52. about the library. Hash tables (especially address-based ones) are possibly the
  53. single most useful data structures ever invented.
  54.  
  55. I said:
  56.    The restriction I have in mind for my language Pepper is that no object can
  57.    have a length bigger than that which will fit in a fixnum (an small
  58.    integer), which limits them to 2^29 elements. 
  59.  
  60. Ug! queried:
  61.  
  62.    Hmm.  Why 2^29?  Shouldn't it be 2^31?  Anyway, both are reasonable approxi-
  63.    mations of infinity at the moment.
  64.  
  65. Two bits for a tag.
  66.  
  67. I said:
  68.  
  69.    I'd vote *against* abstract data types and for a simple but powerful module
  70.    structure. After all, all ADTs do is to restrict the names that the user is
  71.    allowed access to -- they're not allowed to use the representational names,
  72.    eg, the fields of a structure; rather, they have access via a set of
  73.    procedures. But this is just what modules are for, so why conflate the two
  74.    concepts? [C++ does this with classes, and look at the resulting mess.]
  75.  
  76. Ug! said:
  77.  
  78.    The reason is reuseability.  You can fudge it by returning some sort of
  79.    'handle' (usually an index into a list), but if you are going to return a 
  80.    handle, why not return the object itself?  Yes,  OO gets around it.  I'm 
  81.    not a fan of OO though.
  82.  
  83. I'd put the object in the heap and return its address -- a perfectly good
  84. handle for the object. I suspect we're at cross-purposes here; what do ADTs
  85. gain you in reusability that module scoping does not?
  86.  
  87. Ug! responds to my ``GARBAGE COLLECTION'':
  88.  
  89.    Ooo.  Garbage Collection.  Nice.  Still, a big hit in speed/performace, etc.
  90.    See Modula-3 (also has freely available ftp'able descriptions).
  91.  
  92. What big hit did you have in mind?
  93.  
  94.    For simplicities sake, however, I am often willing to forgo it.  But is is
  95.    definately a nice idea.
  96.  
  97. For simplicitys sake, I'd put it in. I've written too much C, and handled my
  98. own store allocation too often, to want to force the poor programmer to do it
  99. themselves. 
  100.  
  101.    An idea I didn't mention before: one of the things I dislike is implicit
  102.    inheritance in procedural programming languages (i.e. global or semi-global
  103.    variables).  If you want two routines to share access to a variable, then
  104.    both should have to explicitly inherit it: it shouldn't be made global 
  105.    (ala C).
  106.  
  107. Use full lexical scoping and first-class procedures, as in Common Lisp, Scheme,
  108. Pop11, Standard ML. 
  109.  
  110.    Modula-2 fundges a solution with local modules.  But in the case where
  111.    A & B share X.  B & C share Y.
  112.    ...ouch.  But it happens (all to commonly).  Some sort of explicit 
  113.    inheritance control in this case would be nice.
  114.  
  115. What does it buy you? Use modules and put up with the fact that B can see X. If
  116. necessary have the compiler tell you. The idea is nice, but in practice it's
  117. just make-work for the programmer.
  118.  
  119. Other things: initialised declarations; unassignable names (``constants'');
  120. incremental compilation; first-class procedures; first-class everything; full
  121. lexical scoping.
  122. --
  123.  
  124. Regards,                    | "I always prefered Sherlock Holmes to Dan Dare"
  125. Kers.                       | Nathan Spring, in BBC2's _Star Cops_.
  126.