Jim Snavely on 17 Oct 2011 18:51:37 -0700


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

Re: Function Fall Next Paper: Continuation, functions and jumps


Kyle,

I had the same impression on reading this: its all very interesting,
but what's it good for?
Why would I want to use glorified parameterized goto's?

My friend Aaron Mansheim, who unfortunately won't be joining us,
pointed me to this rather terse blog post

http://jtauber.com/blog/2008/03/30/thunks,_trampolines_and_continuation_passing/

wherein James Tauber implements the factorial recursively using CPS
and without python's stack limitations.

Aaron found this post while looking for a way to implement optimized
tail recursion in his toy implementation of Lisp.

--Jim

On Fri, Oct 7, 2011 at 10:35 AM, Kyle R. Burton <kyle.burton@gmail.com> wrote:
>> Our next paper is Continuation, functions and jumps
>> (http://www.cs.bham.ac.uk/~hxt/research/Logiccolumn8.pdf) and we will
>> be discussing it on Wednesday, 10/19/2011, at 6:30 pm on the 45th
>> floor of the Comcast Center. Food, as always, will be provided by
>> Comcast Interactive Media.
>
> I see the paper mentions both Lambda Calculus and Pi Calculus.  I've
> actually already read through the paper while skipping those equations
> - does anyone have a recommended resource that's an introduction to
> Lambda or Pi Calculus?  So it'd be possible for a drop-out like me to
> read the paper in it's full academic glory?
>
>> I am really looking forward to learning all about continuations!
>
> Interesting that the paper only goes so far in describing
> continuations - it almost describes them as a curiosity w/o any reason
> as to why you'd want to consider them [1] or, even better, use them.
> It also only really describes them in terms of CPS, which is a good
> way (IMO) to get a base understanding of them, but misses some of what
> comes with full continuation support.
>
> It's going to be an interesting discussion, that's for sure :)  I've
> had a very long and difficult journey trying to wrap my mind around
> continuations and I'm not convinced I really get them.  There are
> terms that I'm not convinced I fully understand the difference
> between: CPS (Continuation Passing Style); Delimited Continuations
> (supported in Common Lisp, which can not support 'full'
> continuations); and 'full' continuations (which are supported by
> Scheme).  I'm not sure where Ruby's continuations fall here.
>
> Here's to hoping y'all will help me improve my knowledge on this.
>
> Kyle
>
>
>
> [1] Continuation Based Web Frameworks are one argument for
> continuations.  For me to get the 'why' of this, I think it is
> important to understand IoC and how it changes how you have to write
> your code (vs sequential code - like a command line program) and how
> computation progresses through your program:
>
>  http://en.wikipedia.org/wiki/Inversion_of_control
>
> The thesis for the continuation based web frameworks (Seaside,
> Uncommon Web, Weblocks, ...) then is that they allow you to
> 're-invert' the IoC and start writing (what looks like) simple
> sequential code again:
>
>  http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.75.2753&rep=rep1&type=pdf
>
> There are other uses for Continuations - but they're often described
> as a tool that allows you to invent/create your own control structures
> (like: for, while, catch, throw, etc), including ones that allow a
> non-linear flow to be written as if it was...
>
> --
> Twitter: @kyleburton
> Blog: http://asymmetrical-view.com/
> Fun: http://snapclean.me/
>



-- 
--Jim