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