Deno 1.0: Node.js Makers Have New JavaScript Runtime For TypeScript Programming Language

The makers of the widely used JavaScript server-side runtime, Node.js, have released Deno 1.0, a new runtime for JavaScript and TypeScript that addresses "design mistakes" in Node.js.

The Deno JavaScript project has been under development by Node.js creator Ryan Dahl for the past two years and his team of contributors has now released Deno 1.0, which could become just as important for JavaScript developers as Node.js.

JavaScript is one of the most widely used programming languages, and it's employed on every device with a web browser. Just like Node.js or Node, the Deno runtime is for executing JavaScript outside a web browser. 

However, unlike Node.js, Deno offers first-class support for Microsoft's increasingly popular Typescript, a superset of JavaScript designed for large projects. 

Deno is based on Google's Chromium V8 JavaScript engine and written in programming language Rust as opposed to C++ for Node. 

Besides fixing problems with Node.js, Dahl also wanted Deno to cater for JavaScript being a very different language today than it was in 2009, when he designed Node. Additionally, because of Node's wide use, Node has become difficult to update. 

"With the changing JavaScript language, and new additions like TypeScript, building Node projects can become an arduous endeavor, involving managing build systems and other heavy-handed tooling that takes away from the fun of dynamic language scripting," writes Dahl in a blogpost co-authored by fellow Deno developers Bert Belder and Bartek Iwańczuk. 

"Furthermore the mechanism for linking to external libraries is fundamentally centralized through the NPM repository, which is not in line with the ideals of the web," he adds, referring to Node's NPM packages.  

The Deno core is written in Rust, and Deno 1.0's main component is the Deno command line interface (CLI). 

Dahl says Deno is not a monolithic program, but rather a collection of Rust "crates" – packages or software libraries – that allow integration at different layers. For example, the Deno core crate is the "very bare bones" of Deno, while the rusty_v8 crate provides Rust bindings to V8's C++ application programming interface (API). 

"The crate provides binaries that are built in GitHub Actions CI, but it also allows users to compile V8 from scratch and adjust its many build configurations," Dahl writes.

"All the V8 source code is distributed in the crate itself. Finally rusty_v8 attempts to be a safe interface. It's not yet 100% safe, but we're getting close. 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."

Dahl also stresses that Deno is not a fork of Node, but a completely new implementation, albeit with similar goals to Node. It's also not, in general, compatible with NPM. However Dahl expects Deno will eventually be able to run more Node programs out of the box.

Deno's performance on web server is about equal to Node, according to Dahl, but Deno has better latency than Node. 

"A hello-world Deno HTTP server does about 25k requests per second with a max latency of 1.3 milliseconds. A comparable Node program does 34k requests per second with a rather erratic max latency between 2 and 300 milliseconds," he notes.

RECENT NEWS

Reassessing AI Investments: What The Correction In US Megacap Tech Stocks Signals

The recent correction in US megacap tech stocks, including giants like Nvidia, Tesla, Meta, and Alphabet, has sent rippl... Read more

AI Hype Meets Reality: Assessing The Impact Of Stock Declines On Future Tech Investments

Recent declines in the stock prices of major tech companies such as Nvidia, Tesla, Meta, and Alphabet have highlighted a... Read more

Technology Sector Fuels U.S. Economic Growth In Q2

The technology sector played a pivotal role in accelerating America's economic growth in the second quarter of 2024.The ... Read more

Tech Start-Ups Advised To Guard Against Foreign Investment Risks

The US National Counterintelligence and Security Center (NCSC) has advised American tech start-ups to be wary of foreign... Read more

Global IT Outage Threatens To Cost Insurers Billions

Largest disruption since 2017’s NotPetya malware attack highlights vulnerabilities.A recent global IT outage has cause... Read more

Global IT Outage Disrupts Airlines, Financial Services, And Media Groups

On Friday morning, a major IT outage caused widespread disruption across various sectors, including airlines, financial ... Read more