guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: guile-vm 0.3


From: Marius Vollmer
Subject: Re: guile-vm 0.3
Date: 13 Apr 2001 03:20:04 +0200
User-agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.7

Michael Livshin <address@hidden> writes:

> 1) I don't see any `capture-continuation'/`reinstate-continuation'
>    primitives.  I assume this is because continuation primitives are
>    packaged up as "known functions", right?

Hmm, not even known functions.  I was thinking about using the
existing Guile mechanism for continuations, which uses a jmpbuf and a
stack copy.  That is, "call/cc" would be a normal function that is
invoked via "invoke".  The compiler would only have to deal with
continuations in that it will have to perform `assignment
elimination', that is, it would have to put local variables that are
mutated into the heap (as part of a closure that it has to create
anyway, or explicitely).

In any case, it is probably possible to implement call/cc via some
"inline" op.  These inline ops are supposed to be real low level and
expressed in the target language of the compiler.

> 2) you do explicitly say that this IL is Scheme-oriented.  what would
>    be the minimal set of additions to make it suitable as a target for
>    an Elisp compiler?  for CL?  for Python?

Interesting question.  I don't know.  The `labels' thing should be
general enough to be usable for all local control structures known to
man.  It should also be efficient.

For Elisp, the lexical scoping is not of much help, I think, but
dynamic scoping, buffer local variables and stuff should be easy to
add.  Either as "inline" ops, or as new special forms that are more or
less trivial to implement.

CL?  I can't think of any specific problem right now.

I don't know enough about Python.  Maybe it needs special support for
its OO features, but probably not.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]