Since you're a .NET programmer you should be more familiaer with my project
Jscex since it brings the idea from F# Async Workflow and the API is more
similiar as C# 5 (e.g., CancellationToken, Task.WhenAll, Task.WhenAny).
https://github.com/JeffreyZhao/jscex
The English docs is quite out-dated since I'm working hard in Chinese
community, but the samples are always the lastest. You can contact me for
detail information.
Jeffrey Zhao
Blog: http://blog.zhaojie.me/
Twitter: @jeffz_cn (Chinese) | @jeffz_en (English)
-----Original Message-----
From: Chris Scribner
Sent: Monday, February 27, 2012 11:35 AM
To: nodejs
Subject: [nodejs] Re: Thinking asynchronously
Yeah fibers as a crutch isn't recommended. It should be a tool, but not
until you can do it without the tool :)
It feels odd for me to disagree with the person who wrote fibers, but
I'll present another viewpoint. I've seen these sort of comments often
when I bring up fibers, and I think they unnecessarily conflate node's
threading model with writing code in Continuation Passing Style.
The best way I've always learned a new language or framework is just
to jump in and get something working. There's so many details I don't
know yet -- I need some small bits that I can focus on first.
I think it's completely reasonable someone could jump into node and
use fibers to remove the complexity of writing code in CPS. It's a
gentler introduction to coding in node, as they can more readily apply
knowledge they likely already have of c style languages.
They can learn CPS when needed -- which at first would just be for
reading others' code.
Whether you use fibers or CPS, you still have to learn node's
threading model and how it handles I/O. This is really the heart of
node, and it's the same knowledge for both cases. There's no intrinsic
link between async I/O and writing code in CPS.
In Scheme and LISP it's not uncommon to use CPS form when writing
synchronous code. In .NET 5 the async and await keywords, which are
similar to the fibers approach, are available.
I wouldn't feel that I need to tell a .NET coder to learn the old way
of doing async first (unless I just wanted him to feel my pain),
because using async / await will be much more straightforward. And I
feel exactly the same way about fibers in node.
Chris
--
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