Live data from Hacker News

Node.js, a popular tool for building modern internet services, has split in two

wired.com

101–110 of 166 posts

Re: Node.js, a popular tool for building modern internet services, has split in two

#101

Earlier quoted context omitted.

It's a widely held misconception that JS doesn't have threading. User code executes in a single thread, but asynchronous tasks are managed by a thread pool (libuv in node). Because the multi-threading is hidden with asynchronous calls, the user doesn't need to worry about it, which is why many people say JS is single-threaded. In fact worker threads execute async tasks behind the scenes; it's a very nice feature of t…

Really? I've never seen any synchronization code (e.g., locks) in JavaScript. If multiple threads can execute async tasks in parallel, doesn't that mean JavaScript needs synchronization primitives? Most JS code I've seen in the wild relies implicitly on the single-threaded assumption—that only one callback (for example) will run at a time.

Say you wanna make an HTTP request.

What node will do is kick off the process (dns, grab a socket, connect tcp, write the header, wait for response etc.)... but it won't wait for any of this to finish, it just starts it on another thread. That thread doesn't need any JS-level synchronization because it has nothing to do with JS. Furthermore, you can kick off multiple requests like this in parallel.

When a request is done and has data to pass back, the external thread will queue up a V8 event. When V8 is free and is ready for the next event, it will see the finished request and trigger your callback with the data. When you're done handling that data (in Javascipt), V8 will wait for the next event and so on.

So you see, it's parallel but doesn't need any JS synchronizatioon.

Re: Node.js, a popular tool for building modern internet services, has split in two

#102

Earlier quoted context omitted.

It's a widely held misconception that JS doesn't have threading. User code executes in a single thread, but asynchronous tasks are managed by a thread pool (libuv in node). Because the multi-threading is hidden with asynchronous calls, the user doesn't need to worry about it, which is why many people say JS is single-threaded. In fact worker threads execute async tasks behind the scenes; it's a very nice feature of t…

Is that a language feature or a runtime/library feature though?

The language is designed to handle events/messages because it runs on single thread in the browser. As far as I know, you cannot spawn threads.

The runtime/library does it under the hood.

Re: Node.js, a popular tool for building modern internet services, has split in two

#103
post #71
post #21

Earlier quoted context omitted.

Docker is not being forked. CoreOS (which is another company, not a "democratic community") is launching a competing project: Rocket, and tries to leverage the popularity of Docker for that.

There is a point to be made about Docker, even though it hasn't been forked. The prevailing sentiment in yesterday's thread about the new Docker announcements was one of worry over whether it was too much of a land grab by the people at Docker, Inc and whether we should be trusting so much of our infrastructure to one company that hasn't yet started to monetize the technology but will almost certainly do so at some p…

> whether we should be trusting so much of our infrastructure to one company that hasn't yet started to monetize the technology

We trusted free software for a long time before we needed to call it open source to make it sound palatable to less visionary business leaders.

We'll go on trusting the FOSS. The free and open nature of it means that we're never really trusting the company (the corporate entity) just the people they've amassed to work on the FOSS. Those people can continue to work on the FOSS after the company disolves, because the osftware is open/free.

Re: Node.js, a popular tool for building modern internet services, has split in two

#104
post #60
post #6

Earlier quoted context omitted.

I can think of MySQL. While I wouldn't call it dead by any measure it certainly suffered when the spit happened.

Yeah, but how much of that was due to forking and how much of that was folks realising that PostgreSQL is much better than MySQL for most metrics of better?

Yes, but Postgres had lots of technical advantages of MySQL for years, and still was less popular. For most uses people would decide "MySQL is good enough feature-wise for me. It's so popular it's probably safest ecosystem-wise"

It was the MariaDB fork that shook people up. Now suddenly the decision became "should I bet on one of these forks, or should I skip that drama and use Postgres which seems like a nice stable project" The fork is really what changed the game.

Re: Node.js, a popular tool for building modern internet services, has split in two

#105
post #52

Earlier quoted context omitted.

Off topic, I guess, but color me unimpressed by the guy claiming he would fire someone for rejecting a pull request that does nothing but advance a political agenda.

He didn't just reject it, he tried to undo it after it was accepted by someone else.

He didn't just try to undo it, he `git push -f`'d over it.

Re: Node.js, a popular tool for building modern internet services, has split in two

#106

Earlier quoted context omitted.

I see this more as a return to reality from Node.js's astronomical levels of hype. The use cases for a single-threaded web server are specific and limited in the real world. Node.js will continue to solve those use cases (simple web server for static content or I/O bound apps) but the resultant decline will lead some to believe that the framework is dying.

Perhaps you could name some website/app servers that aren't mostly i/o (or event-timing) bound? I wouldn't say the use cases are limited at all. You can always run multiple process instances, and communication between processes isn't really so different in practice than inter-server communication... Which just means you are scaling horizontally by design earlier in development.

I worked on some web-based project management software which was highly CPU-bound.

A typical scenario would be the application querying a database for financial figures, doing a large amount of calculations on those figures and then generating an HTML report from them. I imagine any application with large amounts of business logic like this will be the same.

Re: Node.js, a popular tool for building modern internet services, has split in two

#107
post #2

> actually set up this foundation because they’re still hoping that Joyent will let them to use the Node.js trademark. Is that naivete on the side of Io.js here, or is there more to the story?

I'm not sure what you're asking, you left out the key part of the quote: > the team hasn’t actually set up this foundation because they’re still hoping that Joyent will let them to use the Node.js trademark. Frankly, I kinda like the name Io.js better than Node.js

> Frankly, I kinda like the name Io.js better than Node.js

Well, if it was for a project that was implementing Io [0] on top of JavaScript, sure. For a server-side JS stack based on V8, I don't really like the name at all.

[0] http://iolanguage.org/

Re: Node.js, a popular tool for building modern internet services, has split in two

#108
post #30

Earlier quoted context omitted.

What kind of services are they?

Hello World, a todo list and a blog application. After that we put "proficient experience with node.js" on all of our developers their CVs. Our company website now lists that we have "enterprise grade expertise with Node.JS" and I haven't even talked about the nodejs-rebranding of our social media dootprint (exclusively liking, following and interacting with nodejs content). We are basically swimming in nodejs client…

#dootprint

Re: Node.js, a popular tool for building modern internet services, has split in two

#109

Earlier quoted context omitted.

Off topic, I guess, but color me unimpressed by the guy claiming he would fire someone for rejecting a pull request that does nothing but advance a political agenda.

Color me impressed, because the political agenda that's being advanced is gender equality in technology, which to me seems pretty worthy.

[deleted]

Re: Node.js, a popular tool for building modern internet services, has split in two

#110

Earlier quoted context omitted.

Really? I've never seen any synchronization code (e.g., locks) in JavaScript. If multiple threads can execute async tasks in parallel, doesn't that mean JavaScript needs synchronization primitives? Most JS code I've seen in the wild relies implicitly on the single-threaded assumption—that only one callback (for example) will run at a time.

Say you wanna make an HTTP request. What node will do is kick off the process (dns, grab a socket, connect tcp, write the header, wait for response etc.)... but it won't wait for any of this to finish, it just starts it on another thread. That thread doesn't need any JS-level synchronization because it has nothing to do with JS. Furthermore, you can kick off multiple requests like this in parallel. When a request is…

How much time in a typical Node application is spent executing JS, vs. how much is in the C++ networking code?
Post reply on HN