Re: An Acceptable Lisp



On 2008-08-26, Jon Harrop <jon@xxxxxxxxxxxxxxxxx> wrote:
Matthew D Swank wrote:
He also said:
"There should be a simple, easily implementable kernel to the Lisp. That
kernel should be both more than Scheme -- modules and macros -- and less
than Scheme -- continuations remain an ugly stain on the otherwise clean
manuscript of Scheme.

What's wrong with continuations?

Continuations are one of those features that, as a user, you will probably pay
for even if you don't use them.

Of course, I mean real, first-class, re-invocable, dynamic continuations: the
kind which capture the entire call stack, so that you can re-enter a previously
saved context, and then return through its entire call chain, which may
traverse separate compilation units.

This type of object is the only thing that is worthy of being called
``continuation'', but the distinction needs to be made because of lesser hacks
which are called continuations.

If you implement real continuations so that there is no cost to programs which
don't use continuations, the implementation will suck donkey dung for programs
that do use continuations.

The problem is that a separately-compiled module of code which calls other
modules will have to support being traversed by continuations even if it
doesn't actually use them. If it is compiled to use a regular stack for its
local variables (i.e. user doesn't pay for the continuation feature that isn't
being used), the creation of a continuation will become expensive; it will have
to go back and clone the entire stack.

Lexical closures don't have this problem. If you don't use them, you don't pay.
A function that doesn't close over anything can be compiled in a way that is
oblivious to lexical closures. If a parent function calls some external child
function that makes closures, that activity has no interaction with the parent
function.
.



Relevant Pages

  • Re: Continuations & Native threads
    ... well as native threads? ... but if you want continuations you must go with scheme. ... For Scheme, you could use MzScheme or Guile embedded in a top level C ... a continuation capture the binding or should it use the current ...
    (comp.lang.scheme)
  • Re: Continuations & Native threads
    ... but if you want continuations you must go with scheme. ... For Scheme, you could use MzScheme or Guile embedded in a top level C ... They can execute Scheme code in native threads in a ... a continuation capture the binding or should it use the current ...
    (comp.lang.scheme)
  • Re: Cross-lisp questions and my #lisp experience
    ... | miss by using Lisp instead of Scheme: continuations. ... it is extremely important when designing a web app to *think* ...
    (comp.lang.lisp)
  • Re: Common Lisp / Scheme comparison
    ... > spec and several implementations dozens of variously comprehensive ... > which provide some extensions. ... the Scheme spec seems to be more in the way of a "guideline". ... > continuations are worth the cost of stack copying, ...
    (comp.lang.lisp)
  • Its all good.
    ... I think scheme is a logical ... as a lisp that has maximally robust continuations. ... There may be other ways to do it, sure; but he's using a lisp, ... Sometimes Common Lisp, Sometimes Scheme. ...
    (comp.lang.lisp)