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

Ryan Dahl, Bert Belder and Bartek Iwańczuk have slid open the doors to Deno 1.0, the first production release of a new runtime for running TypeScript and JavaScript outside a web browser.

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.”

Among his regrets were not using JavaScript Promises, which were added to Node in 2009 but removed in 2010. “I foolishly removed them,” he said, and as a result many Node async APIs are “aging badly.” Another regret is security and the lack of a Node sandbox. The build system using GYP (Generate Your Projects) is “an awful experience for users,” he said.

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.

These frustrations led to the new effort, called Deno (if you shuffle the letters about you get something familiar), based on “what would be a nice server side JavaScript runtime these days.” It is built on V8 (the JavaScript engine used by Chromium and Node.js) but unlike Node, takes advantage of the V8 sandbox for security. There is no file, network or environment access unless explicitly enabled.

A Deno web server in three lines of code (well, with a hefty import)

A Deno web server in three lines of code (well, with a hefty import)

Deno also uses Rust. Deno_core is a Rust crate that anyone can use to embed a JavaScript runtime into Rust, and Deno is built on deno_core. Another crate, rusty_v8, provides Rust bindings to the V8 C++ API; it “attempts to be a safe interface” but is not yet 100 per cent safe. “Being able to interact with a VM as complex as V8 in a safe way is quite amazing and has allowed us to discover many difficult bugs in Deno itself,” the release post explained.

Scheduling is handled by Tokio, an asynchronous runtime for Rust. Another key component is TypeScript, which is the primary language in Deno. You can run a TypeScript file directly; there is no need to compile it to JavaScript, as we demonstrated by slightly adapting the demo in the post and running a Deno webserver in three lines of code.

Deno architecture

Deno architecture

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. ®

Other stories you might like

  • Florida's content-moderation law kept on ice, likely unconstitutional, court says
    So cool you're into free speech because that includes taking down misinformation

    While the US Supreme Court considers an emergency petition to reinstate a preliminary injunction against Texas' social media law HB 20, the US Eleventh Circuit Court of Appeals on Monday partially upheld a similar injunction against Florida's social media law, SB 7072.

    Both Florida and Texas last year passed laws that impose content moderation restrictions, editorial disclosure obligations, and user-data access requirements on large online social networks. The Republican governors of both states justified the laws by claiming that social media sites have been trying to censor conservative voices, an allegation that has not been supported by evidence.

    Multiple studies addressing this issue say right-wing folk aren't being censored. They have found that social media sites try to take down or block misinformation, which researchers say is more common from right-leaning sources.

    Continue reading
  • US-APAC trade deal leaves out Taiwan, military defense not ruled out
    All fun and games until the chip factories are in the crosshairs

    US President Joe Biden has heralded an Indo-Pacific trade deal signed by several nations that do not include Taiwan. At the same time, Biden warned China that America would help defend Taiwan from attack; it is home to a critical slice of the global chip industry, after all. 

    The agreement, known as the Indo-Pacific Economic Framework (IPEF), is still in its infancy, with today's announcement enabling the United States and the other 12 participating countries to begin negotiating "rules of the road that ensure [US businesses] can compete in the Indo-Pacific," the White House said. 

    Along with America, other IPEF signatories are Australia, Brunei, India, Indonesia, Japan, South Korea, Malaysia, New Zealand, the Philippines, Singapore, Thailand and Vietnam. Combined, the White House said, the 13 countries participating in the IPEF make up 40 percent of the global economy. 

    Continue reading
  • 381,000-plus Kubernetes API servers 'exposed to internet'
    Firewall isn't a made-up word from the Hackers movie, people

    A large number of servers running the Kubernetes API have been left exposed to the internet, which is not great: they're potentially vulnerable to abuse.

    Nonprofit security organization The Shadowserver Foundation recently scanned 454,729 systems hosting the popular open-source platform for managing and orchestrating containers, finding that more than 381,645 – or about 84 percent – are accessible via the internet to varying degrees thus providing a cracked door into a corporate network.

    "While this does not mean that these instances are fully open or vulnerable to an attack, it is likely that this level of access was not intended and these instances are an unnecessarily exposed attack surface," Shadowserver's team stressed in a write-up. "They also allow for information leakage on version and build."

    Continue reading
  • A peek into Gigabyte's GPU Arm for AI, HPC shops
    High-performance platform choices are going beyond the ubiquitous x86 standard

    Arm-based servers continue to gain momentum with Gigabyte Technology introducing a system based on Ampere's Altra processors paired with Nvidia A100 GPUs, aimed at demanding workloads such as AI training and high-performance compute (HPC) applications.

    The G492-PD0 runs either an Ampere Altra or Altra Max processor, the latter delivering 128 64-bit cores that are compatible with the Armv8.2 architecture.

    It supports 16 DDR4 DIMM slots, which would be enough space for up to 4TB of memory if all slots were filled with 256GB memory modules. The chassis also has space for no fewer than eight Nvidia A100 GPUs, which would make for a costly but very powerful system for those workloads that benefit from GPU acceleration.

    Continue reading
  • GitLab version 15 goes big on visibility and observability
    GitOps fans can take a spin on the free tier for pull-based deployment

    One-stop DevOps shop GitLab has announced version 15 of its platform, hot on the heels of pull-based GitOps turning up on the platform's free tier.

    Version 15.0 marks the arrival of GitLab's next major iteration and attention this time around has turned to visibility and observability – hardly surprising considering the acquisition of OpsTrace as 2021 drew to a close, as well as workflow automation, security and compliance.

    GitLab puts out monthly releases –  hitting 15.1 on June 22 –  and we spoke to the company's senior director of Product, Kenny Johnston, at the recent Kubecon EU event, about what will be added to version 15 as time goes by. During a chat with the company's senior director of Product, Kenny Johnston, at the recent Kubecon EU event, The Register was told that this was more where dollars were being invested into the product.

    Continue reading
  • To multicloud, or not: Former PayPal head of engineering weighs in
    Not everyone needs it, but those who do need to consider 3 things, says Asim Razzaq

    The push is on to get every enterprise thinking they're missing out on the next big thing if they don't adopt a multicloud strategy.

    That shove in the multicloud direction appears to be working. More than 75 percent of businesses are now using multiple cloud providers, according to Gartner. That includes some big companies, like Boeing, which recently chose to spread its bets across AWS, Google Cloud and Azure as it continues to eliminate old legacy systems. 

    There are plenty of reasons to choose to go with multiple cloud providers, but Asim Razzaq, CEO and founder at cloud cost management company Yotascale, told The Register that choosing whether or not to invest in a multicloud architecture all comes down to three things: How many different compute needs a business has, budget, and the need for redundancy. 

    Continue reading

Biting the hand that feeds IT © 1998–2022