Seeking Continuations Links

  • Thread starter James Edward Gray II
  • Start date
J

James Edward Gray II

Myself and a few others are trying to get together a "Playing Around
with Continuations" project. As a start, we are collecting any
resources we can find about them.

If you have links to any continuations related material, would you
please reply and post them here. I will start us off:

General Definition --
http://en.wikipedia.org/wiki/Continuations

Ruby Based Tutorials --
http://www.rubygarden.org/ruby?Continuations
http://www.deepwood.net/~mikael/continuations/

Ruby Examples --
http://eigenclass.org/hiki.rb?Continuations+are+so+much+easier+to
+grasp+than+2ch

Ruby Projects Using (at least some) Continuations --
http://rubyforge.org/projects/wee/

Other Languages --
http://www.intertwingly.net/blog/2005/04/13/Continuations-for-
Curmudgeons

Thanks for any links you can provide.

James Edward Gray II
 
A

ara.t.howard

Myself and a few others are trying to get together a "Playing Around with
Continuations" project. As a start, we are collecting any resources we can
find about them.

If you have links to any continuations related material, would you please
reply and post them here. I will start us off:

General Definition --
http://en.wikipedia.org/wiki/Continuations

Ruby Based Tutorials --
http://www.rubygarden.org/ruby?Continuations
http://www.deepwood.net/~mikael/continuations/

Ruby Examples --
http://eigenclass.org/hiki.rb?Continuations+are+so+much+easier+to
+grasp+than+2ch

Ruby Projects Using (at least some) Continuations --
http://rubyforge.org/projects/wee/

Other Languages --
http://www.intertwingly.net/blog/2005/04/13/Continuations-for-Curmudgeons

Thanks for any links you can provide.


http://lambda-the-ultimate.org/node/1036

http://www.google.com/search?as_q=c...h=http://caml.inria.fr&as_rights=&safe=images


trying to get a headache james? ;-)

regards.

-a
 
G

gabriele renzi

James Edward Gray II ha scritto:
If you have links to any continuations related material, would you
please reply and post them here. I will start us off:

maybe useful:
http://c2.com/cgi/wiki?CallWithCurrentContinuation (and linked)
http://lambda-the-ultimate.org/node/86
http://www.sidhe.org/~dan/blog/archives/000185.html
http://www.madore.org/~david/computers/callcc.html

Also, I have a page in italian about a small part of what Kernel#callc
is.. but I don't think it is worth adding the link :)
 
J

James Britt

James said:
Myself and a few others are trying to get together a "Playing Around
with Continuations" project. As a start, we are collecting any
resources we can find about them.

Is there a an online copy (video, I hope) of the continuations talk by
Jim Weirich and Chad Fowler from RubyConf05?

It was really quite good.
 
J

James Edward Gray II

trying to get a headache james? ;-)

<laughs> Probably.

I guess we figured there was safety in numbers, so... well... we
could get headaches together. :)

Thanks all for the terrific links.

James Edward Gray II
 
A

Adam Sanderson

Headaches for all!

I have a feeling that contiuations are an excellent solution for a
problem I haven't found yet. Though I want to find this problem,
because I have a suspiscion that using continuations to solve it will
make me feel much cooler ;)

.adam
 
J

Jeff Rose

------=_Part_609_12198989.1139319159543
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Myself and a few others are trying to get together a "Playing Around
with Continuations" project. As a start, we are collecting any
resources we can find about them.

I don't have a link, but last night a buddy and I found a cool usage for
continuations and AOP in implementing a network simulator. The general ide=
a
might work for testing drb code as well, although we haven't gone that far
yet.

Our simulator is a typical discrete event based simulator, and previously w=
e
had been using messages (packets) to communicate between virtual nodes in
the network. For our current project we wanted to implement a p2p algorith=
m
in an rpc style though, which seemingly would require us to implement proxy
objects for everything that would send messages so it can all go through th=
e
simulator. Then we realized that by just wrapping any methods which should
be treated as "remote" with some message passing code we could possibly use
the same code for simulation as for an implementation (yet to be verified o=
n
anything real...). Either way this saves a lot of time, and after some
initial unit testing it seems to be working correctly. Here is the wrapper
method, which hopefully shows how it is working: (It's shorter than it
looks. Mostly just comments so a couple months down the line these
continuations don't require another neural re-wiring :)

----------------------------------
module GoSim
module Net
# Wrap the methods of a class so they are called through the
# network simulator.
def Net.remote_method(clazz, *methods)
methods.each do |meth|

# Store the original method so we can call it eventually.
original =3D clazz.instance_method(meth)
clazz.instance_eval do

# Define a new method with the same name, which sends
# a message on the call and then another on the return.
define_method(meth) do |*a|

# Save a continuation to return to this point when the
# event fires at a later time.
cont =3D nil
from_sched =3D callcc {|cont|}

# Post the message event and jump back into the
# event scheduling loop. Note that from_sched will be
# true when the continuation is called later.
GoSim::Net::Topology.instance.
transmit_continuation(cont) unless from_sched

# Make the actual method call
retval =3D original.bind(self).call(*a)

# Now do it over again for the return value.
cont =3D nil
ret =3D callcc {|cont|}
GoSim::Net::Topology.instance.
transmit_continuation(cont) if ret.nil?

retval
end
end
end
end # def remote_method
end # Net
end # GoSim
----------------------------------
Make sense? Think this could work to simulate a bunch of drb objects
communicating with each other? Could be a handy way to unit test
distributed applications etc...

-Jeff

------=_Part_609_12198989.1139319159543--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top