
Knit, Chisel, Hack: Building Programs in Guile Scheme (2016) [video] - tosh
https://youtube.com/watch?v=uwiaT3MoDVs
======
bjoli
Guile 3 is happening soon as well, giving us almost 3x the speed. I am a very
happy guile user. It is a very fun scheme to be working in, and delimited
continuations (as mentioned in the video) blows call/cc so far out of the
water that it isn't even funny :)

~~~
convolvatron
re: delimited continuations

i'm a big fan of 'normal' continuations, have looked at this work before, and
just now tried to figure out what the win is from reading wiki.

to me it seems like an complicated and unnecessary layer above call/cc.

but I think I'm just not getting something important. could you post a good
reference or describe why you find them to be a compelling abstraction?

~~~
bjoli
Full continuations capture things you do not want to capture, which easily
leads to bugs. Delimited continuations can do everything call/cc can, only
faster and easier to reason about. Call/cc captures the state of the whole
program, which is not what you want. It is expensive, slow and error prone.

In my experience delimited continuations has about 4x less overhead (this is
in guile which has really expensive call/cc though) and produces a lot faster
code.

Oleg Kiselyov has written a lot about it:
[http://okmij.org/ftp/continuations/against-
callcc.html](http://okmij.org/ftp/continuations/against-callcc.html)

Matthew Flatt spoke about them at Microsoft research with comparisons to
call/cc: [https://www.microsoft.com/en-us/research/video/delimited-
and...](https://www.microsoft.com/en-us/research/video/delimited-and-
composable-continuations-in-plt-scheme/)

The gist of both of them are: you never want undelimited continuations even
when you think you need them.

Properly implemented delimited continuations will always be faster and more
memory efficient than call/cc (except for maybe in chicken scheme) and are
imho easier to work with. They also compose with the current continuation
which makes them a lot more pleasant.

If you want a practical argument for delimited continuations, watch the video
with Matthew Flatt.

~~~
convolvatron
thank you. oleg in particular is always very clear and comes from a pragmatic
perspective that i appreciate.

~~~
bjoli
In the video with Matthew Flatt he talks about continuations by building a
continuation based web server. That nicely illustrates the problem of full
continuation capture.

It is pretty easy to understand why racket and guile went for delimited
continuatiins.

