Deno in 2021
2021 was the first full year of funded development on Deno. Our company is 10 strong and growing.
Since the 1.0 release in May 2020 the Deno CLI has been developing at a steady pace. In 2021 we shipped 44 releases (11 minor, 33 patch), landing key features, countless bug fixes and significant performance optimizations. For details on each release, see corresponding blog posts: v1.7, v1.8, v1.9, v1.10, v1.11, v1.12, v1.13, v1.14, v1.15, v1.16, v1.17.
Let’s explore a few major developments:
Deno Deploy
We released the first Beta of Deno Deploy last summer. It’s a modern serverless cloud built from the ground up by our engineering team, that allows users to very quickly deploy JavaScript, TypeScript, and WASM services to data centers around the world.
We’re actively developing & investing in Deno Deploy. We think of it as our third JavaScript runtime; after building Node.js and Deno CLI.
We’re excited about the opportunity to build a modern runtime with cloud-first primitives that shapes how teams build & ship software.
We hope to share more about this next-generation system in the coming months.
An optimized core
Deno’s core provides “opcalls” (similar to syscalls), allowing JavaScript to call into Rust functions provided by the runtime (fs/net/url-parsing/…).
Prior to v1.9 we marshalled opcall values via a mix of JSON & binary buffers.
The efficiency of the op-layer is a key contributor to the runtime’s overall performance. Opcalls previously had ~4000ns of overhead per call, now reduced nearly 100x to ~40ns per call.
The bulk of these efficiency gains were a result of serde_v8, a ~maximally efficient bijection between Rust & V8 values that we designed and shipped in v1.9.
This alone reduced the cost of common operations (otherwise unchanged) such as URL parsing by over 3x and has enabled Deno to mature as a fast JS runtime.
Native HTTP
In Deno v1.9 we shipped
native HTTP server bindings, which were later stabilized in
Deno v1.13.
These bindings allow you to create high-performance HTTP servers backed by
hyper
in only a few lines of code:
import { serve } from "https://deno.land/std@0.140.0/http/server.ts";
serve((_req) => new Response("Hello, world"), { port: 3000 });
Because these bindings are built on
hyper
, they deliver great throughput and
latency.
MDN Compatibility Tables
In August 2021 Deno was added to the MDN compatibility tables.
Deno takes web compatibility seriously; we test Deno against
WPT (or Web Platform Tests
), a
test suite used by all major browsers to ensure spec compliance. Test suite
results can be found on
wpt.fyi.
Foreign Function Interface
In Deno v1.13 we replaced the unstable plugin system with a new Foreign Function Interface API. The FFI is still considered unstable, but we think it’s a significant improvement.
Pre-1.13 the native plugin system allowed shipping dynamic libraries authored in Rust. Due to unstable Rust ABI, as well as limiting the API authors to a single language we decided to replace that system with a generic FFI API. This API allows developers to write “extensions” to the Deno runtime in any language that uses C calling convention.
We already saw some interesting projects using FFI API, showcasing how powerful FFI API can be.
Slack & next-gen platforms
In November 2021, Slack announced its next generation development platform built on Deno. In addition to Slack, we’ve been working with other partners to build & ship great Deno-powered products. We believe Deno Deploy’s “Isolates as a Service” provide solid foundations for:
- Modern edge-hosting
- User-extendable platforms (bots, plugins, apps, etc…)
- Low-code solutions
If you’re building similar products and think Deno technology could be a fit, please reach out to deploy@deno.com !
Node.js Compatibility
In Q4 2021 we started efforts to provide first-class Node.js compatibility. Allowing Deno to run apps & libraries (NPM packages) developed for Node.js directly in Deno, unchanged.
In Deno v1.15, we shipped a first preview of
“compat mode”. The feature is still unstable but can be enabled using the
--compat
flag. Most of the work involves providing polyfills in
std/node.
Some critical modules like tls
and zlib
are still incomplete, but in its
current form you can still run non-trivial applications. We’re aiming to ship a
first iteration suitable for all users in the coming months.
The Road to Deno 2
In September of 2021, we started to discuss what a Deno 2 release might look like. There are many obvious small API changes that should be addressed but we are also investigating fundamental changes to improve the Deno workflow. Soon we’ll be releasing a roadmap for Deno 2 and hope to ship it in the first half of this year. It will focus on better NPM ecosystem compatibility, better DX for common workflows and exploring alternative package management solutions.