Kyle R. Burton on 20 Oct 2011 07:36:34 -0700


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

Re: Functional Fall tomorrow


> I took the liberty of writing a few examples in ruby (since it has
> continuations) that I could walk through during the discussion if
> people are interested:
>
>  https://github.com/kyleburton/sandbox/tree/master/examples/ruby/continuations

Trevor asked me to forward the code examples I used last night.
They're at that link above in my sandbox project on GitHub.  Also
included is the other code I was typing up that mirrored the SICP code
where you define storage (a cons cell) with nothing but a lambda
(closure) and a conditional (in this case: if, but you could do it
with any conditional).  Keep in mind that doing it this way is the
opposite of efficient, it's just beautiful (to me) that you can do
something like invent storage with such basic constructs.

Michael Glaseman also pointed out that the Ruby examples won't run
with Ruby 1.9, since (I think) they don't (yet, though I think it's
coming) have support for continuations where they did in Ruby 1.8.x.

Other technologies that you can use to explore continuations:

 Uncommon Web:

    Common Lisp, delimited continuations
    http://common-lisp.net/project/ucw/

 Weblocks:

    Common Lisp, delimited continuations
    http://weblocks.viridian-project.de/

 Chicken:

    A full R5RS Scheme.  The full monty: call/cc
    http://common-lisp.net/project/ucw/

    I've done some minor work with Chicken and I think it's a great
    Scheme implementation (fast, easy integration with C libraries)
    and has lots of libraries (for a Scheme), and a cpan/gem style
    library system:

       http://wiki.call-cc.org/chicken-projects/egg-index-4.html

 Clojure:

    (delimited) https://github.com/swannodette/delimc


Unfortunately (?) these are all Lisps, which are the only technologies
I know if where you can commune with continuations outside of ruby
1.8.

Does anyone else know of other approachable languages that support
full (or even delimited) continuations?

Thanks for all the great discussion last night.  Continuations were
definitely something I wanted to learn more about and y'all helped me
with it a lot.

Regards,

Kyle

-- 
Twitter: @kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/