Hacker News new | ask | show | jobs
by paxys 1211 days ago
We created JavaScript to run complex code in the web browser.

This worked well, until someone went – hey, we should also use this cool language on the server side. So node.js was born, and it added extra APIs for stuff like filesystem access and web servers that the V8 sandbox didn't allow.

Then someone went – hey, wouldn't it be neat to run all this cool node.js code in the browser? So Nodebox and Webcontainers were born that wrote a compatibility layer and added pollyfills for all the node.js-specific APIs that were missing in V8, and so some of this code was able to run in the browser.

My question is – why couldn't all this code run directly on the browser in the first place without Node.js and Nodebox?

3 comments

Because this would be too easy?

Modern computers and their software are all Rube Goldberg machines, and we're only adding new parts instead of finally having a critical look at the whole and rethink the monstrosity from the ground up (considering all we know by now, of course).

NodeJS pffft... Netscape livewire was doing JS on the server side in 1996.
What do you mean? Most of Node's APIs are available on the web and vice-versa but they're slightly different, so if you want to run the same code in both places you need some shims.