From: | basile.starynkevitch@cea.fr |
Newsgroups: | comp.lang.java,comp.compilers,comp.lang.scheme |
Date: | 20 Jan 1996 14:42:15 -0500 |
Organization: | Commissariat a l'Energie Atomique - France |
References: | 96-01-037 96-01-045 96-01-049 |
Keywords: | translator |
"Peter Seibel" <seibel@sirius.com> writes: |So I'm asking
> you all: how easy/hard/impossible would it be to write a
> |compiler for your favorite language(s) that compiles to
> Java VM |byte-codes.
> bnm@indica.bbt.com says...
> A compiler can target either a CPU or a VM. Either can be
> defined by an ISA (instruction set architecture).
> [I believe the counter-argument to the first point is that
> in many cases the choice would be between cumbersome code
> and no code at all. -John]
In an article I remember reading but didn't save, Anselm Baird-Smith
<Anselm.BairdSmith@inria.fr> said that to compile Scheme into Java-VM
would be difficult because of continuations. Anselm does know well the
subject, since he designed and implemented OScheme -a Scheme dialect,
with prototype based objects, ftp to koala.inria.fr:/pub/OScheme) as
an efficient virtual machine.
Explicit continuations (such as those provided by Scheme's
call-with-current-continuation primitive), when implemented on a stack
based (virtual or real) machine, nearly requires machine support,
since the stack (or segments in it) have to be copied elsewhere. An
alternative is to allocate all activation frames on the heap, hence
without using any stack. This is actually doable, and work efficiently
(see the SML/NJ implementation). In that case, dead activation frames
are not popped but became garbage (and their memory is reused by a
garbage collector).
----------------------------------------------------------------------
Basile STARYNKEVITCH ---- Commissariat a l Energie Atomique (civil)
DRN/DMT/SERMA * C.E. Saclay bat.470 * 91191 GIF/YVETTE CEDEX * France
fax: (33) 1- 69.08.85.68; phone: (33) 1- 69.08.40.66; homephone: (33) 1- 46.65.45.53
email: basile.starynkevitch@cea.fr (redirected to basile@soleil.serma.cea.fr);
I speak french (natively), english, russian. Je parle francais, anglais, russe.
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.