i think this probably still needs further clarification.

fibers (when used as a module as Marcel describes) takes a callback and within 
that callback you're in a fiber. this could be adapted to "when you're in a 
yield" instead of "when you're in a callback".

but, common-node (and maybe some other libraries) have abstracted away that 
callback when you're living in their abstraction by using fibers under the hood 
(i'm sure Oleg will pop in any minute to explain how). the way yield is 
described for generators does not lend itself to ever being abstracted to that 
degree.

this isn't a judgement call about which one is better/worse, personally, i 
don't like fibers or generators :), but it's an important distinction for 
people who think that "all these callbacks" are a issue that needs to be solved 
by abstracting them all away (or in the case of common-node want to create a 
Narwhal compatible environment). one of these tools potentially does that 
(although it doesn't by default when used as a module) and the other never can.

On Feb 10, 2012, at February 10, 20121:56 PM, Marcel Laverdet wrote:

> 2) As of node 0.6.0, node-fibers is just a module. It never was a fork, but 
> in node 0.4.0 it was much more of a hack. In node 0.6.0 it works just like 
> any other module, you install it, require it, and use it.
> 
> 3) Depending on how you use fibers, it may be possible to rewrite your code 
> using generators, it may not be. Fibers will give you a superset of 
> functionality and it's up to you to look at what generators will be and build 
> your code to support them in the future if that's what you want.
> 
> On Fri, Feb 10, 2012 at 12:55 PM, Mikeal Rogers <[email protected]> 
> wrote:
> fibers and generators (as described in harmony) have a large delta between 
> them.
> 
> if you read the harmony spec for generators you'll notice that the yield 
> statement pushes it's way all the way up the call stack so you can't abstract 
> it away the same way common-node does with fibers.
> 
> what you should probably do is just use normal node, the way 99% of the 
> community does :)
> 
> 
> On Feb 10, 2012, at February 10, 20121:35 PM, Marco Rogers wrote:
> 
>> 1) node will support harmony generators the second they are stable in v8. 
>> The language evolves with v8, node doesn't touch it.
>> 
>> 2) To my knowledge, node-fibers is a fork of node with patches to both node 
>> and v8 to enable fibers. So you can't just run node, you have to run 
>> node-fibers.
>> 
>> 3) I think it would be very easy to paint yourself into a corner here. But 
>> there are lots of abstractions on top of fibers that could possibly be 
>> implemented later with generators instead. Keep in mind that when you dig 
>> into the details, fibers seem to allow deeper semantic changes in node than 
>> the version of generators in harmony. I'm not the best person to explain the 
>> difference, but I've understood enough of the talk to know they are not 
>> equivalent paradigms. Generators enable a subset of functionality that 
>> fibers does.
>> 
>> Hope this helps.
>> 
>> :Marco
>> 
>> -- 
>> Job Board: http://jobs.nodejs.org/
>> Posting guidelines: 
>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>> You received this message because you are subscribed to the Google
>> Groups "nodejs" group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]
>> For more options, visit this group at
>> http://groups.google.com/group/nodejs?hl=en?hl=en
> 
> 
> -- 
> Job Board: http://jobs.nodejs.org/
> Posting guidelines: 
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
> 
> 
> -- 
> Job Board: http://jobs.nodejs.org/
> Posting guidelines: 
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to