From: | fjh@cs.mu.OZ.AU |
Newsgroups: | comp.compilers |
Date: | 23 Jan 1996 17:27:52 -0500 |
Organization: | Compilers Central |
References: | 96-01-037 |
Keywords: | interpreter, prolog |
> The "easy/hard/impossible" of retuning a compiler's back end to target
> Java's VM is probably most dependent on the source language's memory
> model and whether or not the language is interpretable. Languages
> like Lisp, Smalltalk, Prolog, Basic, Fortran, Pascal, Modula-n, Forth,
> and Ada are probably candidates for retargeting.
I think it would be very difficult to retarget the back end of a Prolog
compiler to Java's VM, if you care at all about efficiency, because it
is very different to the abstract machine that most Prolog compilers
for backtracking.
Most Prolog compilers use an abstract machine which is a variant of
Warren's Abstract Machine (WAM). For just one example of the sort of
issues involved, the WAM has a number of registers, and translating
these to static variables in the Java VM in a would introduce
significant inefficiency.
It would perhaps be possible to rewrite (not just "retune" or
"retarget") a compiler's backend using a different execution model that
was easier to map to the Java VM. However, that is a rather different
proposition. Even then, the lack of support for backtracking in the
Java VM poses some fundamental challenges; efficient compilation of
Prolog to a conventional high-level language is still an open
research issue.
--
Fergus Henderson WWW: http://www.cs.mu.oz.au/~fjh
fjh@cs.mu.oz.au PGP: finger fjh@128.250.37.3
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.