Hacker Newsnew | comments | ask | jobs | submitlogin
Ruby: Fibers vs Continuations (all-thing.net)
24 points by luccastera 459 days ago | comments


3 points by pmjordan 458 days ago | link

I wish we had either (ideally both) in the JVM. I frequently come across situations with clojure where using a coroutine or continuation would be the cleanest solution. There are various libraries that use some kind of bytecode instrumentation to achieve it, but this places serious constraints on where and how you can use them. Really, this needs to be a VM feature.

I wonder if it's possible to apply the same hack as this one for .NET:

http://msdn.microsoft.com/en-us/magazine/cc164086.aspx

Basically, use the low-level, OS (C) fiber/coroutine facility and attach the fiber as a thread.

-----

1 point by davatk 457 days ago | link

It mainly deals with Scheme, but http://portal.acm.org/citation.cfm?id=1086393 examines implementing continuations on VMs that don't support them.

-----

2 points by carterschonwald 459 days ago | link

As far as I can tell, fibers can be implemented from continuations as long as you have first class closures. I think the better question is what are the best continuation based abstractions to be included in a language's standard library :)

-----




Lists | RSS | Search | Bookmarklet | Guidelines | FAQ | News News | Feature Requests | Y Combinator | Apply | Library

Analytics by Mixpanel