News for hackers. Stuff that matters.
Re:Node v4.0.0 by dcwca on Tuesday September 08, 2015 @04:45PM (#10188129)
I can't reply to the grand-child of this post, so here's my reply.

It seems that you don't like Node and are intent not to use it. I respect that and am not trying to push it. I think asynchronous programming in the reactor pattern is a good solution pattern for many types of problems, and Node.js is a solid application of that pattern. But it certainly is more complicated than synchronous programming in the kinds of environments you listed.

I do wonder however what compels you to shit all over a thread celebrating a project milestone with an opinion that comes from an admitted lack of knowledge.

Re:Node v4.0.0 by blowski on Tuesday September 08, 2015 @04:52PM (#10188157)
I'm not 'shitting all over Node'. I do use it for certain applications, and would love to use it more because it is a fantastic solution for some problems. As a back-end for websockets it's in a league of its own, and 'Isomorphic JavaScript' is very exciting if you ever need to hire developers.

I am using this discussion as a means of saying "here's what I think Node needs to get more people using it in production". My opinion is that they need to do more work on stability of the API, and improve documentation, to win over us enterprise types who value long-term stability over short-term features.

Re:Node v4.0.0 by sanderjd on Tuesday September 08, 2015 @07:09PM (#10188727)
Just because I think you'll find this useful (and not because I want to denigrate Node, which I think is great tech, especially with the upgrades in this announcement), have you seen Phoenix[0]? Despite immaturity, I think it is already close to being in Node's league as a back-end for websockets, but seems to have a philosophy you may enjoy more. That is, it reminds me a lot more of Rails and Django than anything in Node. (I also think Elixir is awesome to work with, but that's somewhat beside the point.)

[0]: http://www.phoenixframework.org/

Re:Node v4.0.0 by Gigablah on Wednesday September 09, 2015 @04:31AM (#10190374)
This is an announcement about the Node open source community finally overcoming their differences and making strides towards platform stability, yet your first response is to complain about "massive instability" (which turns out to be more about individual libraries than the platform itself) and how you "wouldn't hold Node up as a great example of the open source community". I can't see this as anything more than a slap in the face.

My opinion? You probably should withhold your judgement of the "open source community" if you only have superficial knowledge about their efforts.

Re:Node v4.0.0 by coldtea on Tuesday September 08, 2015 @05:29PM (#10188315)
>I think asynchronous programming in the reactor pattern is a good solution pattern for many types of problems, and Node.js is a solid application of that pattern.

Asynchronous programming a la Node (with callbacks etc) is an anti-pattern.

We've had better ways to handle that for 4 decades now.

Re:Node v4.0.0 by nocman on Tuesday September 08, 2015 @06:26PM (#10188548)
For the benefit of any who are not sure what you are talking about, could you please elaborate on what some of these "better ways to handle that" are?

It would make your comment much more helpful, IMHO.

Re:Node v4.0.0 by AdieuToLogic on Wednesday September 09, 2015 @01:08AM (#10189799)
> For the benefit of any who are not sure what you are talking about, could you please elaborate on what some of these "better ways to handle that" are?

While I am not certain what the GP specifically references, I can say that about 40 years ago the Actor model[1] was officially documented. The literature documenting benefits of an Actor model over a callback approach are easily found. For understanding the pain which callback-based systems often produce, a person can familiarize themselves with the Win32 API (disclaimer: this is a masochistic exercise not recommended for anyone).

1 - https://www.cypherpunks.to/erights/history/actors/AIM-410.pd...

Re:Node v4.0.0 by pdpi on Wednesday September 09, 2015 @04:04AM (#10190305)
Even if you don't go the actor route, if you're going to use continuation passing style as much as Node wants you to, having a language with better CPS support would be much nicer
Re:Node v4.0.0 by spankalee on Tuesday September 08, 2015 @08:16PM (#10188947)
Blocking threads.

People associate threads with shared-memory concurrency, which can be really hard to deal with, but shared heaps are not the important part - blocking is.

Blocking threads means that all your functions can call each other, all control flow constructs just work, and debugging is sane. With blocking threads functions don't need to belong to a special class of async functions that in general need to be called from other async functions.

It would have been great if node invested in allowing many concurrent blocking JS threads. To see what that could have looked like, see Dart's Fletch project: https://github.com/dart-lang/fletch

Re:Node v4.0.0 by spion on Tuesday September 08, 2015 @09:37PM (#10189195)
Now that we have ES6 generators, this is much less of an issue.
Re:Node v4.0.0 by spankalee on Tuesday September 08, 2015 @10:46PM (#10189401)
Generators don't help with the sync/async split.

Generators are just iterators, and are synchronous. The consumer asks for a value with next() and the value must be computable (even if that value is a Promise).

If you have an async function (one that returns a Promise or in the future a Stream), and you need to call it from a sync function, and somehow incorporate the future value into the return value of the sync function, you're stuck. You have to async-ify your functions all the way up the call chain.

With blocking this isn't a problem. We just need environments that make blocking cheap.

Re:Node v4.0.0 by spion on Wednesday September 09, 2015 @05:54AM (#10190565)
In my experience in practice there is no big difference, really, its just a matter of a few keywords.

As for "having to change an entire call stack", that just stopped happening after a while. The rule of thumb was that if the function is impure (e.g. relying on mutable state) then it will likely become async, too. That lets me plan ahead.

Re:Node v4.0.0 by coldtea on Wednesday September 09, 2015 @05:31AM (#10190512)
Anything other: blocking in an Erlang like system, actors, CSP, real continuations, async/await, etc.
Re:Node v4.0.0 by sanderjd on Wednesday September 09, 2015 @11:07AM (#10191888)
What are the differences between what you reference as "actors" and "CSP"?