Re: Interpreter design

anton@mips.complang.tuwien.ac.at (Anton Ertl)
20 Jan 2001 16:12:35 -0500

          From comp.compilers

Related articles
[4 earlier articles]
Re: Interpreter design steck@rice.edu (2001-01-18)
Re: Interpreter design gsc@zip.com.au (Sean Case) (2001-01-19)
Re: Interpreter design gvmt@localhost.vsnl.net.in (Venkatesha Murthy) (2001-01-19)
Re: Interpreter design jcgil@gmv.es (Juan Carlos Gil Montoro) (2001-01-19)
Re: Interpreter design guerby@acm.org (Laurent Guerby) (2001-01-19)
Re: Interpreter design neelk@alum.mit.edu (2001-01-19)
Re: Interpreter design anton@mips.complang.tuwien.ac.at (2001-01-20)
Re: Interpreter design nr@labrador.eecs.harvard.edu (2001-01-26)
Re: Interpreter design sdm7g@minsky.med.virginia.edu (Steven D. Majewski) (2001-02-01)
| List of all articles for this month |

From: anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.compilers
Date: 20 Jan 2001 16:12:35 -0500
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
References: 01-01-109
Keywords: design, architecture
Posted-Date: 20 Jan 2001 16:12:35 EST

  "Venkatesha Murthy" <gvmt@localhost.vsnl.net.in> writes:
>But then HOC was amenable to a stack computer. Is every interpreted
>language that way? Runnable on a stack computer?


No. First of all, there are other interpreters than virtual machine
(VM) interpreters, e.g., string or tree interpreters. And even among
the VM interpreters, there are VM instruction sets that are not
similar to stack machine instruction sets, e.g., the WAM variants used
in Prolog implementations, which are more like register machines.


The reasons for using stack-based VMs are:


1) It's easy to generate code for them from most languages; generating
fewer instructions for a register VM takes quite a bit of effort.


2) Register-based VM instructions take longer to interpret (decoding
and accessing the VM registers takes time), so this pays off only if
there are significantly fewer instructions. Section 2.3 of the
following paper gives some examples.


@InProceedings{ertl95pldi,
    author = "M. Anton Ertl",
    title = "Stack Caching for Interpreters",
    crossref = "sigplan95",
    pages = "315--327",
    url = "http://www.complang.tuwien.ac.at/papers/ertl95pldi.ps.gz"
}


- anton
--
M. Anton Ertl Some things have to be seen to be believed
anton@mips.complang.tuwien.ac.at Most things have to be believed to be seen
http://www.complang.tuwien.ac.at/anton/home.html


Post a followup to this message

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