Planet For Application Life Development Presents
Technology World

Explore and uptodate your technology skills...

News Navigation: First Previous Next Last

Node.js Even Its Creator Thinks Its Flawed
20-Jun-2018

You have to admire Ryan Dahl for creating node.js, even if you don't like it - and there are plenty of people who don't. Now he is back with an admission that node.js isn't as good as it could have been and has something better to offer - Deno.

It is not the basic idea of node.js that is the problem. Taking a JavaScript engine and making an asynchronous system to run a web service is bold plan, and something that a lot of users have decided to work with.

The problem with node.js is in the smaller things that initially didn't seem so important, but over time they have and are now proving crucial. Speaking at JSConf EU, Ryan Dahl admits that he made mistakes - mainly with security and how modules are managed. He adds that there are so many users that depend on it there is no way to change it.

Instead he offers us a second project - Deno, a rearrangement of the letters in node - based on TypeScript rather than JavaScript. The TypeScript compiler sits on top of a V* JavaScript engine so it's still server-side JavaScript, even if you are writing TypeScript.

After spending time away from node.js, working with Go, Dahl only recently returned to node and wasn't happy about what he experienced. He is still happy about its basic architecture - the asynchronous approach that avoids threading. However, by avoiding the module system, it doesn't use npm - he doesn't like the build system for them, module names, and module folders.

Deno tries to do things right this time and who better to get it right than someone who has got it wrong and admitted it. Deno is still experimental. It works using message passing and there is only a single entry point to the virtual machine. It is also very modern JavaScript/TypeScript complete with promises and await. You can control access to the network and file system for added security.

The project is on GitHub and while it is early days it does have 27 contributors which is good for a startup project.

So will node.js give way to Deno?

I doubt it.

Node.js happened at just the right time and running JavaScript in the browser and the server was the big attraction. Adding a compile time step for TypeScript is something that many programmers don't want to do.

This said, there is probably room for both.