# Concerns about removal of continuations in Ruby 2.0

**URL:** <https://www.ruby-forum.com/t/concerns-about-removal-of-continuations-in-ruby-2-0/74569>\
**Category:** Ruby\
**Created:** [November 7, 2006, 10:48am UTC](https://www.ruby-forum.com/t/concerns-about-removal-of-continuations-in-ruby-2-0/74569 "2006-11-07T10:48:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![alder](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a4c791/32.png) [@alder](https://www.ruby-forum.com/u/alder)\
**Post date:** [November 7, 2006, 10:48am UTC](https://www.ruby-forum.com/t/concerns-about-removal-of-continuations-in-ruby-2-0/74569/1 "2006-11-07T10:48:31Z")

</div>

1. Certain control flow structures rely on continuations:

For instance, Ruby’s generator implementation requires them[1].  
Generators provide the canonical - most natural and convenient -  
solutions for problems as typical as iterating over two or more Arrays  
in parallel, simple suspended execution, resumable functions, and  
others.

1. Existing 3rd-party packages rely on continuations:

For instance, the very popular and useful ruby-breakpoint package is  
designed around continuations.

1. Certain possible features and packages need continuations:

The most obvious example is continuations-based web frameworks like  
Seaside. The Ruby community has always been living on the cutting edge  
of web technologies. Lack of continuations might prevent Rubyists from  
pursuing one of the most interesting recent developments in  
web-programming technology.

-Alder

---

<div class="post-metadata">

**Author:** ![alder](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a4c791/32.png) [@alder](https://www.ruby-forum.com/u/alder)\
**Post date:** [November 7, 2006, 10:48am UTC](https://www.ruby-forum.com/t/concerns-about-removal-of-continuations-in-ruby-2-0/74569/2 "2006-11-07T10:48:35Z")

</div>

On Tue, 2006-10-31 at 18:08 +0900, Alder G. wrote:

> 1. Certain control flow structures rely on continuations:
> 
> For instance, Ruby’s generator implementation requires them[1].

Not any more - check out generator.rb in 1.9 (though what’ll happen if  
we lose green threads too, I don’t know).

---

<div class="post-metadata">

**Author:** ![alder](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a4c791/32.png) [@alder](https://www.ruby-forum.com/u/alder)\
**Post date:** [November 7, 2006, 10:49am UTC](https://www.ruby-forum.com/t/concerns-about-removal-of-continuations-in-ruby-2-0/74569/3 "2006-11-07T10:49:23Z")

</div>

Yukihiro M. wrote:

> - Ruby 1.9.1 will not have continuation, since they have lowest  
> priority and are difficult to implement efficiently.
> 
> - no promise (neither positive nor negative) on continuation for  
> 1.9.2 or 2.0, for exact same reason above.

From a JRuby perspective, we could support continuations, but with the  
same or greater limitations on their utility. With no continuation  
support at the VM level, we would need to avoid deepening the Java call  
stack to allow continuations to function. This isn’t too terribly  
difficult to do for pure Ruby code, but quite difficult and a  
performance hit for Java code. It’s also impossible to do with  
third-party libraries involved that aren’t designed with microthreading  
or stackless execution in mond. There are tools that can microthread  
existing code after-the-fact, but that’s purely experimental.

Of course I don’t believe a language should be developed with platform  
limitations in mind, or I’d be using Groovy…but in this case the  
difficulty of implementing continuations efficiently, portably, and  
correctly with native threads and external libraries involved almost  
seems to outweigh their utility. But I’m not a language design maven, so  
I will not offer my opinion on whether continuations are a worthwhile  
feature. Suffice it to say I haven’t seen any _practical_ applications  
of continuations that couldn’t be implemented in a less abstract (but  
possibly more verbose) way.

---

<div class="post-metadata">

**Author:** ![alder](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a4c791/32.png) [@alder](https://www.ruby-forum.com/u/alder)\
**Post date:** [November 7, 2006, 10:50am UTC](https://www.ruby-forum.com/t/concerns-about-removal-of-continuations-in-ruby-2-0/74569/4 "2006-11-07T10:50:11Z")

</div>

On 10/31/06, Charles Oliver N. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> limitations in mind, or I’d be using Groovy…but in this case the  
> difficulty of implementing continuations efficiently, portably, and  
> correctly with native threads and external libraries involved almost  
> seems to outweigh their utility. But I’m not a language design maven, so  
> I will not offer my opinion on whether continuations are a worthwhile  
> feature. Suffice it to say I haven’t seen any _practical_ applications  
> of continuations that couldn’t be implemented in a less abstract (but  
> possibly more verbose) way.

I will agree that they are rarely used (at least in Ruby), but for a  
nice use case see wee ([http://www.ntecs.de/blog-old/Wee](http://www.ntecs.de/blog-old/Wee)) or Seeside  
(in smalltalk, but more active: [http://www.seaside.st/](http://www.seaside.st/)).

That being said, Matz’s goal of delivering 1.9.1 without continuations  
makes sense as they are rarely used in Ruby (possibly due to their  
inefficiency and/or the richness of Ruby’s existing flow control/block  
semantics).

pth

---

<div class="post-metadata">

**Author:** ![alder](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a4c791/32.png) [@alder](https://www.ruby-forum.com/u/alder)\
**Post date:** [November 7, 2006, 10:49am UTC](https://www.ruby-forum.com/t/concerns-about-removal-of-continuations-in-ruby-2-0/74569/5 "2006-11-07T10:49:20Z")

</div>

Hi,

In message “Re: Concerns about removal of continuations in Ruby 2.0”  
on Tue, 31 Oct 2006 18:08:45 +0900, “Alder G.”  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

|1. Certain control flow structures rely on continuations:  
|2. Existing 3rd-party packages rely on continuations:  
|3. Certain possible features and packages need continuations:

Yes, yet they are few. What I said were:

- Ruby 1.9.1 will not have continuation, since they have lowest  
priority and are difficult to implement efficiently.

- no promise (neither positive nor negative) on continuation for  
1.9.2 or 2.0, for exact same reason above.

---

<div class="post-metadata">

**Author:** ![alder](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a4c791/32.png) [@alder](https://www.ruby-forum.com/u/alder)\
**Post date:** [November 7, 2006, 10:55am UTC](https://www.ruby-forum.com/t/concerns-about-removal-of-continuations-in-ruby-2-0/74569/6 "2006-11-07T10:55:11Z")

</div>

Yukihiro M. wrote:

> - Ruby 1.9.1 will not have continuation, since they have lowest  
> priority and are difficult to implement efficiently.
> 
> - no promise (neither positive nor negative) on continuation for  
> 1.9.2 or 2.0, for exact same reason above.

An old saying in programming language design states that the toughest  
part of language design is knowing what to leave out. Given that, if it  
is decided to leave continuations out of 1.9.1, perhaps it is wiser to  
leave them out “forever”, or at least until Ruby 3.0.

Of course, _I_ want to see them stay in “forever”, so this is all  
rhetorical. 🙂

Incidentally, the Carbone project (Ruby VM using the “vmgen” base) is  
indeed inactive – I asked the developer. I haven’t looked at the source  
yet, but I just might, given that.
