[nodejs] Re: Future of asynchronous programming in node

2013-08-25 Thread Staffan Eketorp
Somewhat like galaxy, somewhat not, I made a new package available for generator usage. Please have a look at https://npmjs.org/package/yyield and give me your opinions! Sorry for being brief now :) --- > Hi guys, > > today I read something about the upcomming es6 generator

[nodejs] Re: Future of asynchronous programming in node

2013-08-15 Thread Bruno Jouhier
Right! I was in the logic of my own bench, which is just a simple loop. If you are benching with concurrent requests it doesn't make much difference. Bruno On Tuesday, August 13, 2013 1:16:10 AM UTC+2, spion wrote: > > > > On Monday, August 12, 2013 10:23:51 AM UTC+2, Bruno Jouhier wrote: >> >>

[nodejs] Re: Future of asynchronous programming in node

2013-08-12 Thread spion
On Monday, August 12, 2013 10:23:51 AM UTC+2, Bruno Jouhier wrote: > > A lot of things can happen in 1ms. In our app the average tick processing > time is below 100µs. > > Not when there are 2000 requests happening in parallel: if each I/O operation still takes 1ms in that case, then ~ 2 000 0

[nodejs] Re: Future of asynchronous programming in node

2013-08-12 Thread jmar777
> And I really worried about the fact that many people here dislike callbacks in Node. I think that may be a misrepresentation of the general sentiment (although I can only speak for myself). I'm a fan of callbacks, but I'm also a fan of easily maintainable code. Callbacks are extremely easy

Re: [nodejs] Re: Future of asynchronous programming in node

2013-08-12 Thread Marcel Laverdet
> We were running it in "callbacks" mode before and we switched to "fibers-fast" mode recently. It made a big difference: the application is now 5 times faster and it uses 2 or 3 times less memory!! Niice. I had a strong feeling that would be the case. Sometimes powerful tools have to be dange

[nodejs] Re: Future of asynchronous programming in node

2013-08-12 Thread Bruno Jouhier
> > Most of our code is not very fancy from an algorithmic standpoint, it is > rather mundane business logic with if/else tests and foreach loops. And our > team is not made of PhD guys, rather PHP guys (PhD guys would be bored by > what we do anyway). > Sorry team! You are all beyond PHP but

[nodejs] Re: Future of asynchronous programming in node

2013-08-12 Thread Bruno Jouhier
On Monday, August 12, 2013 9:46:44 AM UTC+2, Chaoran Yang wrote: > > I've read everyone's post up to this point in this thread. And I really > worried about the fact that many people here dislike callbacks in Node. > > Before I came to node world, I used C#, Java, Python, Ruby to write code >

[nodejs] Re: Future of asynchronous programming in node

2013-08-12 Thread Bruno Jouhier
On Monday, August 12, 2013 1:06:37 AM UTC+2, spion wrote: > > Bruno, > > Gorgi, continuing the discussion here because comments seems to be off on >> your blog. >> > > Haven't turned off the comments - its a generated static site, and I'm > still thinking if I should add something like disqus

[nodejs] Re: Future of asynchronous programming in node

2013-08-12 Thread Chaoran Yang
I've read everyone's post up to this point in this thread. And I really worried about the fact that many people here dislike callbacks in Node. Before I came to node world, I used C#, Java, Python, Ruby to write code running on server. And I don't like them. Why? because they are synchronous.

[nodejs] Re: Future of asynchronous programming in node

2013-08-11 Thread spion
Bruno, Gorgi, continuing the discussion here because comments seems to be off on > your blog. > Haven't turned off the comments - its a generated static site, and I'm still thinking if I should add something like disqus to it > It is great that you took the time to write all these variants o

[nodejs] Re: Future of asynchronous programming in node

2013-08-11 Thread Bruno Jouhier
Gorgi, continuing the discussion here because comments seems to be off on your blog. It is great that you took the time to write all these variants of the same program, and that you analyzed it under diffferent angles. Very well done and well presented. I just have another comment on the perfo

[nodejs] Re: Future of asynchronous programming in node

2013-08-10 Thread Bruno Jouhier
Good job Gorgi. You have tested a single function making several async calls. It would be interesting to also test with several layers of async calls (async f1 calling async f2 calling async f3 ...). My guess is that you will see a significant difference in the way fibers compares with the othe

[nodejs] Re: Future of asynchronous programming in node

2013-08-09 Thread Peter Petrov
Great and very helpful analysis, Gorgi. Thanks a lot. On Friday, August 9, 2013 8:11:22 PM UTC+3, spion wrote: > > I just finished writing an analysis of many node async patterns (with > special attention given to generator patterns): > > > http://spion.github.io/posts/analysis-generators-and-ot

[nodejs] Re: Future of asynchronous programming in node

2013-08-09 Thread spion
I just finished writing an analysis of many node async patterns (with special attention given to generator patterns): http://spion.github.io/posts/analysis-generators-and-other-async-patterns-node.html There are comparisons for code complexity, performance, memory usage and debuggability. Ho

Re: [nodejs] Re: Future of asynchronous programming in node

2013-08-07 Thread Angel Java Lopez
+1 to Gagle Callbacks are simple, clear and explicit. Every feature implemented in Node.js core, should be accept a callback (except sync versions). Even stream API deserves a simple implementation with callback (something like stream.read(cb)); Userland is the place for any other wrapper implem

[nodejs] Re: Future of asynchronous programming in node

2013-08-07 Thread Gagle
I like how javascript works. I like to use callbacks. Other languages that lack of callbacks (Java) require a lot of code to do the same (instantiating an anonymous interface that defines methods). Learn to love the callbacks. I don't like tu use helper libraries like promises. For me they are p

Re: [nodejs] Re: Future of asynchronous programming in node

2013-08-05 Thread Rick Waldron
On Mon, Aug 5, 2013 at 11:36 PM, jmar777 wrote: > Does anyone know if "Deferred Functions" with the `await` keyword has been > entirely dropped from the ES7 roadmap? Early discussions around it seemed > to rely on "thenables". No, there is still opportunity to discuss `await` Rick > > I onl

[nodejs] Re: Future of asynchronous programming in node

2013-08-05 Thread jmar777
Does anyone know if "Deferred Functions" with the `await` keyword has been entirely dropped from the ES7 roadmap? Early discussions around it seemed to rely on "thenables". I only ask because actual syntax-level sugar for asynchronous interactions using "native" Promises is about the only thin

[nodejs] Re: Future of asynchronous programming in node

2013-08-05 Thread Bruno Jouhier
You can already write in sync style with ES6 generators. Take a look at: https://github.com/bjouhier/galaxy https://github.com/jmar777/suspend The fact that generators are shallow continuations is not a problem. Galaxy can handle generator functions calling other generator functions at any dept