>> I'm sorry if this has been discussed before, but I couldn't find anything.
It has, probably 10 times a month. :) No joke! Nuno On Mon, Apr 2, 2012 at 12:09 AM, Isaac Schlueter <[email protected]> wrote: > We're definitely not going to change node in the way you suggest. > > Async is the default by design. Mark Hahn expressed the reasons quite > well, so I won't reiterate them. > > Sync methods look different because they *are* different. > Automatically switching from async to sync would be a violation of > Node's core principles, and a disaster. > > "Node is not pretending it is blocking when it is not." > http://www.mikealrogers.com/posts/the-way-of-node.html > > > On Sun, Apr 1, 2012 at 19:20, Olivier Lalonde <[email protected]> wrote: > > I'm sorry if this has been discussed before, but I couldn't find > anything. > > This a modest proposal to introduce sync APIs in Node.js > > > > A lot of people would like to use Javascript for their web backend, but > > don't want to program in an async style (I believe those reasons have > > already been discussed at length). > > > > As it stands right now, it is practically impossible to program in > Node.js > > in a sync style, since most core modules and native extensions only > provide > > an async interface. > > > > I believe there would be an easy way to change the status quo without > > impacting developers who chose to adhere to a strict async style. The > > solution I propose is simply a pattern for writing I/O APIs: every I/O > call > > should be async unless no call back is supplied, in which case the I/O > call > > should be sync and use return / throw statements instead of calling a > > callback. > > > > There is probably a flaw in my reasoning since I'm probably not the first > > one to come up with this pattern. That being said, I think it would be an > > elegant way to make both async/sync fans happy while keeping all the > backend > > JS community focused on one project rather than fragmenting the > community in > > multiple CommonJS server implementations. > > > > Thoughts? > > > > -- > > 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
