Friday, October 27, 2006

More on Continuations in Ruby

Continuations and ruby seem to be the meme around the 'Net. Chad Fowler posted a small piece rebutting the rumor that continuations are getting the axe (permantently), which read to Patrick Logan's Ruby Sucks post. Lots of other bloggers have posted about it (blogsearch). It's even come up in email between the various implementers.

It seems a lot of the people who are doing the implementation work on the alternative Ruby implementations don't see the value of continuations if they're going away (even temporarily). I won't pretend to be able make the case one way or the other, but maybe I can organize some thoughts that will let other folks do so more effectively:

  • Continuations are a part of Ruby 1.8, and will be part of some (probably not .1 or .2) version of 1.9
  • Continuations are hard to implement on some VMs
  • Not a lot of people are using continuations in Ruby (but some are)
  • One key aim of the alternative implementations is to codify what Ruby 1.8 is and build that
  • Most of the implementations are going to differ from Ruby in some ways &mdash e.g., JRuby doesn't get to use OpenSSL, so they'll have to fake it.

So, what to do?

  • If you're a continuations devotee, show us why they're important! Use them in a really cool app where not having them would make things suck. (RHDL and expat might be good examples, Seaside certainly is[1] — heck, even Rails uses continuations (not much though).) Even better, write an implementation for them for the VM you most want to use Ruby on.
  • If you want to see them go away, show us why continuations are just a bunch of performance chewing overhead! Replace them in apps that use them (or in little mockups), make your case.

In either case, talking about it on this blog (or others), or on mailing lists will only go so far. At some point, code needs to be written (or shown off if it's already there), decisions need to be made, and we'll all need to move along.

[1]Borges is/was a Ruby version of Seaside, it's basically died because Ruby's continuations were neither serializable nor performant (if I've got my history straight).

2 comments:

Anonymous said...

I think this post by Avi Bryant pretty much explains what really happened with the family of frameworks he created or was involved with (Seaside / Borges / Iowa / Wee)

Avi Bryant on Wee, and why Wee works well without continuations

Best,
UG

gnupate said...

uma,
nice link. Avi's always fun to read.

thanks,
pate