Node.js creator delivers Deno 1.0, a new runtime that fixes 'design mistakes in Node'
Please help us rewrite the TypeScript compiler in Rust
Dahl was the original creator of Node, which was focused on event-driven HTTP servers. Deno is not a fork of node but a new runtime. “Due to the large number of users that Node has, it is difficult and slow to evolve the system,” the team explained this week.
In June 2018, Dahl spoke about design mistakes in Node. He said that Node seemed in good shape when he stepped away from the project in 2012, but this was “so wrong.” He added: “I see the bugs that I made, design mistakes made that just cannot be corrected now.”
Node wraps GYP and this introduces unnecessary complexity. Baking NPM (Node Package Manager) into Node was another issue. Node modules were a mistake, he said, and become too big and complex. “It’s my fault, and unfortunately it’s impossible to undo now,” he said.
Deno is not compatible with Node packages, though there is a “nascent compatibility layer,” and the authors expect many Node applications to run out of the box eventually. Performance is currently both better and worse than Node. A Node program can do more requests per second, but with “erratic max latency,” said the team, whereas a hello world Deno server has a max latency of 1.3 milliseconds (on some unspecified hardware), for example. Unlike Node, Deno's asynchronous sockets are "fundamentally tied to promises" even at the lowest layer, said the team.
Although labelled 1.0, this is early days, and some parts of Deno’s API are marked unstable. In addition, Deno’s standard modules are not yet stable, according to the docs. The team also says that the TypeScript compiler, used internally, is very slow. The intention is to port the TypeScript compiler to Rust, though this is a big project. If done, it would be helpful for all TypeScript developers; and the Deno team is appealing for help.
It's early days, but there is plenty of interest in Deno. “Deno solves many Node.js problems,” said consultant Amine Ait Aazizi on Twitter. “TypeScript bult-in, more complete standard library, no package manager, secure by default.”
Node is not going anywhere, but this should do well. ®