|
|
|
|
|
by dmgbrn
4076 days ago
|
|
Yes and no. Ruby has Fibers, but they're roughly where Python is with generators as coroutines. They're wonderful when working with EM, and one time I wrote a massively overengineered Ruby Warrior program that allowed you to do things like "move(:left) until feel(:left).wall?" instead of doing one thing each time a method was called. This is exactly what makes coroutines so attractive in simulation programs. Still, Fibers are clumsy and counterintuitive and require some abstraction to produce a useful interface. Also, there are some problems related to overflowing the Fiber stack, especially in ridiculously deep Rails stacks, not sure if those have been resolved yet. I'm not sure that special syntax is necessary for widespread adoption of Fibers, since Ruby syntax is flexible enough to provide a sort of DSL for working with Fibers. |
|