Re: Questions about Bytecode

Chris Dollin <chris.dollin@hp.com>
23 Apr 2007 08:53:19 -0400

          From comp.compilers

Related articles
[3 earlier articles]
Re: Questions about Bytecode cfc@shell01.TheWorld.com (Chris F Clark) (2007-04-19)
Re: Questions about Bytecode Sean.D.Gillespie@gmail.com (Bison) (2007-04-20)
Re: Questions about Bytecode anton@mips.complang.tuwien.ac.at (2007-04-23)
Re: Questions about Bytecode ajohnson@mathworks.com (Andy Johnson) (2007-04-23)
Re: Questions about Bytecode DrDiettrich1@aol.com (Hans-Peter Diettrich) (2007-04-23)
Re: Questions about Bytecode haberg@math.su.se (2007-04-23)
Re: Questions about Bytecode chris.dollin@hp.com (Chris Dollin) (2007-04-23)
Re: Questions about Bytecode gah@ugcs.caltech.edu (glen herrmannsfeldt) (2007-04-25)
Re: Questions about Bytecode Peter_Flass@Yahoo.com (Peter Flass) (2007-04-26)
Re: Questions about Bytecode cdiggins@gmail.com (Christopher Diggins) (2007-04-26)
Re: Questions about Bytecode cdiggins@gmail.com (Christopher Diggins) (2007-04-26)
| List of all articles for this month |
From: Chris Dollin <chris.dollin@hp.com>
Newsgroups: comp.compilers
Date: 23 Apr 2007 08:53:19 -0400
Organization: HP labs, Bristol
References: 07-04-06107-04-068 07-04-071
Keywords: interpreter
Posted-Date: 23 Apr 2007 08:53:19 EDT

Bison wrote:


> And as a final side note, is it more common to see one stack or two
> stack machines. What benefits do they have?


It's a bit tricky to implement languages like Pop11 with a single
stack, since it needs two -- one for the call stack, one for the
value stack. (In Pop11 [1], these two are decoupled, which gives
you a whole bunch of powerful idioms and the opportunity for the
occasional brainbreaker.)


So one reason for having two stacks in bytecode is because you
have two stacks to have: in Pop11, both stacks are fundamental
to the effective working of the language.


[The RTL/2 compiler's intermediate language had, if I recall
  correctly, two stacks -- one for values, one for addresses,
  running sort-of independantly [2]. I don't remember back-end
  implementors being delighted with this feature. Since the
  back-end I was involved with started by rebuilding an AST
  from the intermediate code, we didn't much mind. The two-stack
  nature of the intermediate code wasn't due to any feature
  of RTL/2.]


[1] And Forth. And I think Postscript, but Google wasn't giving me
        immediate satisfaction.


[2] As of late 70s/early 80s.


--
"Possibly you're not recalling some of his previous plans." Zoe, /Firefly/
Hewlett-Packard Limited Cain Road, Bracknell, registered no:
registered office: Berks RG12 1HN 690597 England


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.