Deno 1.9 update includes proposal cold-shouldered in February, now hyped as '3x faster' performance bump

Plus HTTP/2 web server written in Rust

Deno 1.9 hit the streets this week touting new features including an HTTP/2 server written in Rust.

An alternative to Node.js, Deno is a runtime for TypeScript and JavaScript on the server, based on the V8 JavaScript engine also used by Google Chrome. It was created by the original developer of Node.js, Ryan Dahl, to improve on what he saw as mistakes in Node.js. A clue to the name may be found in the code "node".split("").sort().join("");.

Deno has always provided an embedded web server, std/http, written in TypeScript. According to the Deno team, "std/http's major down side is that it is HTTP/1.1 only – with no easy path forward towards HTTP/2." The solution was to adapt Hyper, an HTTP/2 server coded in Rust, to become Deno's web server. Deno itself was built in Rust. The new server "improves hello-world throughput by 48 per cent," according to the team, though the API is not yet stable.

The Deno coders have also worked on the binding infrastructure between Rust and V8, with a new, more efficient framework for passing JSON (JavaScript data) to and from Rust libraries, based on a Rust framework called Serde. Dahl was doubtful of the value of this when it was proposed.

He said: "It's an interesting idea but we are skeptical it can be made faster than the status quo. It will also be quite a lot of work just to be able to perf test it. If you decide to play around with it and get some results, we will be eager to see them, but this is not something the core team will pursue."

That was in February. This week Dahl and his colleagues said the changes, now implemented, "substantially improve Deno's efficiency" and that "many common functions in Deno are now up to ~3x faster."

Dramatic performance improvements in Deno 1.9, thanks to a code proposal that was initially dismissed as 'not something the core team will pursue'

Dramatic performance improvements in Deno 1.9, thanks to a code proposal that was initially dismissed as 'not something the core team will pursue'

The 1.9 release has also added support for blob URLs, which are local URLs to local data, and work the same way as they do in the browser. There is also an improved Deno Language Server for VS Code (or other editors), with code completion for import statements and better support for intelligent text selection and folding blocks of code. New optional prompt permissions mean that when code requires additional permissions, it can prompt the user for them instead of throwing an exception.

A Deno company was formed last week to increase investment in the project, and the pace of development shows significant momentum. Perhaps the biggest problem is that migrating a project from Node.js is often not easy.

Node.js has a package manager and registry, npm, which is the most popular package manager in existence: when GitHub acquired npm in 2020, CEO Nat Friedman said it was "home to over 1.3 million packages with 75 billion downloads a month."

Deno uses ES2015 modules whereas npm uses CommonJS; there is a Deno Node compatibility module but it is not perfect and adds friction for developers. Deno may improve on Node, but it is not a drop-in replacement, more something to consider for new projects. ®

Biting the hand that feeds IT © 1998–2021