home *** CD-ROM | disk | FTP | other *** search
- From: kers@hplb.hpl.hp.com (Chris Dollin)
- Date: Tue, 17 Nov 1992 09:58:26 GMT
- Subject: Re: languages which allow the introduction of new operators
- Message-ID: <KERS.92Nov17095826@cdollin.hpl.hp.com>
- Organization: Hewlett-Packard Laboratories, Bristol, UK.
- Path: sparky!uunet!utcsri!newsflash.concordia.ca!garrot.DMI.USherb.CA!uxa.ecn.bgu.edu!mp.cs.niu.edu!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!sdd.hp.com!apollo.hp.com!cupnews0.cup.hp.com!scd.hp.com!hpscdm!hplextra!otter.hpl.hp.com!hpltoad!cdollin!kers
- Newsgroups: comp.lang.misc
- References: <721458276@sheol.UUCP> <veit.721491920@du9ds3> <KERS.92Nov12085629@cdollin.hpl.hp.com> <BxMCxA.3nM@mentor.cc.purdue.edu> <72171
- Sender: news@hplb.hpl.hp.com (Usenet News Administrator)
- Lines: 44
- In-Reply-To: throopw@sheol.UUCP's message of 14 Nov 92 02:21:03 GMT
- Nntp-Posting-Host: cdollin.hpl.hp.com
-
- In article ... throopw@sheol.UUCP (Wayne Throop) writes:
-
- :: From: kers@hplb.hpl.hp.com (Chris Dollin) writes:
- :: Message-ID: <KERS.92Nov12085629@cdollin.hpl.hp.com>
- :: [...] define 5 ++( x, y ); lvars x, y; x + y + 1 enddefine; [...]
- : From: hrubin@pop.stat.purdue.edu (Herman Rubin)
- : Message-ID: <BxMCxA.3nM@mentor.cc.purdue.edu>
- : [...] I would accept that as the insertion of the ++ operator.
-
- :: (Pop is an open-stack language), ``x * y'' means ``push x, push y,
- :: call -'', and ``f(x)'' means ``push x, call f''.
- : But I would object to any language which insists that we use a
- : strictly stack machine. Pushing, popping, and calling are to be
- : avoided unless necessary. Otherwise things just run too slowly to be
- : of more than theoretical use.
-
- This is yet another case of confusing the abstract notation with a
- concrete implementation. Just because the abstract semantics has the
- model of a stack is NO reason to suppose that this forces one to
- implement the model using an explicit stack with explicit push and pop
- operations. (Not being intimately familiar with Pop, it may be that
- Pop *does* require an explicit stack in the implementation, but that
- can't be told just from what Chris said. ...............
-
- It is, perhaps, unfortunate in this instance that Pop's model makes it rather
- hard for an implementation to avoid actually having a stack. When calling
- system procedures (those things often thought of as ``built-ins'', like ``+''
- and ``=''), it should be easy enough to pass parameters via registers, rather
- than on the value stack. However, when calling user procedures, this is much
- more difficult; you don't know how many arguments they take, how many results
- they return, or indeed what procedure they *are* (since, by default, they're
- all variables to allow for incremental development and redefinition).
-
- So, the Pop compiler is free to eliminate stack use where it can prove its not
- necessary. It's just that the proofs are, in general, impossible.
-
- Any more Pop questions should be taken to comp.lang.pop.
-
-
-
- --
-
- Regards | "Always code as if the guy who ends up maintaining your code will be
- Kers. | a violent psychopath who knows where you live." - John F. Woods
-