From: | hbaker@netcom.com (Henry Baker) |
Newsgroups: | comp.lang.java,comp.compilers,comp.lang.scheme |
Date: | 27 Jan 1996 16:02:55 -0500 |
Organization: | nil organization |
References: | 96-01-049 96-01-050 96-01-086 |
Keywords: | GC |
basile.starynkevitch@cea.fr writes:
>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...
will@ccs.neu.edu (William D Clinger) wrote:
> Although this works fairly well with a generational garbage collector
> as in SML/NJ, you wouldn't want to do this with the conservative
> garbage collector currently used to implement the Java VM. You
> wouldn't have to, since nearly all of the standard techniques used to
> compile Scheme into C could be used with the Java VM.
For those who haven't seen it yet, the Cheney-on-the-MTA (inside joke),
also called 'pushy', scheme for doing 'precise' GC in C should work.
See ftp://ftp.netcom.com/pub/hb/hbaker/CheneyMTA.html (also .ps.Z) and
'cboyer13.c' in my ftp/www directory. 'cboyer13.c' is an actual implementation
in very portable ANSI C of the scheme. This program also happens to be
a standard Lisp benchmark, so you can use it to evaluate the efficiency
of the scheme.
> Tail recursion is a more serious problem than first class
> continuations. But again, the standard techniques used to compile
> Scheme-like languages into C could be used with the Java VM, with the
> same 2x hit in overall performance. This inefficiency will disappear
> if Sun allows for tail recursive calls in some future revision of the
> Java VM, as is rumored.
The CheneyMTA scheme mentioned above handles tail recursion, as well.
--
www/ftp directory:
ftp://ftp.netcom.com/pub/hb/hbaker/home.html
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.