Re: Interpreter design (Anton Ertl)
20 Jan 2001 16:12:35 -0500

          From comp.compilers

Related articles
[4 earlier articles]
Re: Interpreter design (2001-01-18)
Re: Interpreter design (Sean Case) (2001-01-19)
Re: Interpreter design (Venkatesha Murthy) (2001-01-19)
Re: Interpreter design (Juan Carlos Gil Montoro) (2001-01-19)
Re: Interpreter design (Laurent Guerby) (2001-01-19)
Re: Interpreter design (2001-01-19)
Re: Interpreter design (2001-01-20)
Re: Interpreter design (2001-01-26)
Re: Interpreter design (Steven D. Majewski) (2001-02-01)
| List of all articles for this month |

From: (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" <> 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.

    author = "M. Anton Ertl",
    title = "Stack Caching for Interpreters",
    crossref = "sigplan95",
    pages = "315--327",
    url = ""

- anton
M. Anton Ertl Some things have to be seen to be believed Most things have to be believed to be seen

Post a followup to this message

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