home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / edu / 1649 < prev    next >
Encoding:
Internet Message Format  |  1992-09-14  |  2.5 KB

  1. Xref: sparky comp.edu:1649 comp.lang.fortran:3546 comp.lang.misc:3064 comp.arch:9403 sci.math:11395
  2. Newsgroups: comp.edu,comp.lang.fortran,comp.lang.misc,comp.arch,sci.math
  3. Path: sparky!uunet!sun-barr!cs.utexas.edu!sdd.hp.com!ux1.cso.uiuc.edu!news.cso.uiuc.edu!aries.scs.uiuc.edu!mcdonald
  4. From: mcdonald@aries.scs.uiuc.edu (J. D. McDonald)
  5. Subject: Re: User-Defined Operators (was: Scientists as Programmers (was: Small Language Wanted))
  6. References: <1992Sep13.022830.2046@CS.ORST.EDU> <1992Sep14.090213.18722@uklirb.informatik.uni-kl.de>
  7. Message-ID: <mcdonald.299@aries.scs.uiuc.edu>
  8. Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
  9. Organization: UIUC SCS
  10. Distribution: na
  11. Date: Mon, 14 Sep 1992 12:50:45 GMT
  12. Lines: 39
  13.  
  14. In article <1992Sep14.090213.18722@uklirb.informatik.uni-kl.de> kirchner@uklira.informatik.uni-kl.de (Reinhard Kirchner) writes:
  15.  
  16. >>>compiler-generation time.  
  17. >> 
  18. >> That last statement is _wrong_.  It is _easy_ to add user-defined operators to
  19. >> a language.  The attributes sufficient to make it easy are:
  20. >> 
  21. >>    operators must be lexically distinct
  22. >>       just like identifiers are not predefined, but are lexically distinct,
  23. >>       so too can operators be lexically distinct
  24. >>    the operator precedence relationships must be static
  25. >>       this is true in languages like C where all the operators are fixed,
  26. >>       and therefore all the precedences are fixed
  27. >>    the operator precedence must be lexically determined
  28. >>       this is easy if you incorporate symbol table information into the
  29. >>       lexer so that on finding an operator, it looks up the precedence
  30. >> 
  31. >If one wants to see and USE a language with user definable operators:
  32.  
  33. >Take Pascal-XSC. It is available on all unix machines since it compiles to
  34. >standard C. It allows users to define operators monadic and dyadic, and it comes
  35. >with many of them for interval, vector, matrix, complex etc. computations.
  36.  
  37. However, the results will be no faster .... and almost surely slower,
  38. than simply coding in C.
  39.  
  40. What you are describing is **NOT** user definable operators in the sense that
  41. they are **needed**!! What is needed is the ability to define operators
  42. that map one-to-one to the exact machine operations that are present,
  43. to give the fastest possible results.
  44.  
  45.  
  46. What you describe adds no new capabilities to the language. You would
  47. still need assembler to access the full capabilities of the machine.
  48. Remember that **NO** langauage can ever add capabilities to assembler,
  49. because assembler can do anything. HLLs  can only prevent use of 
  50. things assembler can do.
  51.  
  52. Doug McDonald
  53.