News for hackers. Stuff that matters.
Re:“Node.js is one of the worst things to happen to the soft... by echelon on Tuesday August 23, 2016 @12:46AM (#12341459)
This seems absurd to me. What exactly are we going to sit there and do while waiting on the data we need to fulfill a query?

I work on services where any given endpoint may handle many thousands of requests per second. We don't care about a slight penalty to query the database, because these are very short, and our services return responses on the order of 100 ms.

Maybe these are things you care about in a language like Javascript, but in something statically typed, they just don't seem like a problem.

Re:“Node.js is one of the worst things to happen to the soft... by WatchDog on Tuesday August 23, 2016 @01:23AM (#12341581)
> What exactly are we going to sit there and do while waiting on the data we need to fulfill a query?

Fulfil more/other queries.

> ...in something statically typed, they just don't seem like a problem.

What has static typing got to do with asynchronous IO?

Re:“Node.js is one of the worst things to happen to the soft... by mplewis on Tuesday August 23, 2016 @01:12AM (#12341548)
You could use the same thread and process to do something else instead of having to spin up another thread or process.

If you're running a web server, you can handle another request, then come back to the first one when the data arrives.

Re:“Node.js is one of the worst things to happen to the soft... by jtrtoo on Tuesday August 23, 2016 @03:06AM (#12341917)
So shouldn't the only question ever be:

* Would we rather burn computing resources (i.e. on new threads) or calendar time+human resources (i.e. on code refactoring)?

Followed closely by:

* And does it even matter for our situation? (i.e. since for many situations getting every last drop of performance out of a system isn't the real obstacle; it's making it do something useful for the end-user or business)

Re:“Node.js is one of the worst things to happen to the soft... by cookiecaper on Tuesday August 23, 2016 @04:05AM (#12342113)
and let's not kid ourselves that anyone trying to get maximum performance out of anything would be running JavaScript. If you need max performance, you write C, and sometimes raw ASM.
Re:“Node.js is one of the worst things to happen to the soft... by akamaozu on Thursday August 25, 2016 @05:14AM (#12357756)
That's like saying if you aren't driving a Veyron you obviously don't care about speed so use a moped.
Re:“Node.js is one of the worst things to happen to the soft... by formula1 on Tuesday August 23, 2016 @06:36AM (#12342638)
Having a successful async paradime helps closer to bare metal by setting a standard for how things should work. Now you can likely find more asynchronous libraries that attempt to copy the functionality of something familiar than creating something completely fresh
Re:“Node.js is one of the worst things to happen to the soft... by mahyarm on Tuesday August 23, 2016 @01:11AM (#12341545)
In a client world, you definitely care about using all of your resources and never halting the rendering/main thread. There is often many things going on at once and you usually need to keep main thread halts under 16ms
Re:“Node.js is one of the worst things to happen to the soft... by jackweirdy on Tuesday August 23, 2016 @05:22AM (#12342394)
> What exactly are we going to sit there and do while waiting on the data we need to fulfill a query?

On the data you need to fulfil one client's query. The answer is that you do stuff you need to fulfil other clients queries, until you're ready to come back to the first one.

I don't see what type systems have to do with your comment either. Scala uses asynchronous concurrency primitives (Futures) and it's statically typed.

Re:“Node.js is one of the worst things to happen to the soft... by greenleafjacob on Tuesday August 23, 2016 @10:29PM (#12349266)
It's common in high performance code to use spin locks (also called busy waiting) to reduce latency. In some circumstances it's better to do nothing and be available almost immediately to do some work than to naively context switch away and pay the penalty of context switching back later. Check out how futexes are implemented in Linux for an example - hybrid mutex and spin lock.
Re:“Node.js is one of the worst things to happen to the soft... by Salgat on Wednesday August 24, 2016 @03:54PM (#12354746)
If you're running a web server, you're processing possibly hundreds of requests at any given time. Especially since JS is single-threaded, you want to minimize blocking by awaiting, aka yielding your thread to another thread to let it continue processing its own request. Async minimizes time spent doing nothing.