With a release that has been pushed back several times and elements still to be put in place, Deno should be usable by the general public within a month, according to Ryan Dahl’s latest comments.
(The Deno runtime was officially released on 13 May 2020, so this article was written before its release.)
Who is Ryan Dahl?
Ryan Dahl is an American developer. He is known in particular for having developed the JavaScript runtime environment Node.js. After 3 years working on Node, Ryan Dahl decided to leave the project and handed over leadership to the creator of the package manager used by Node.js: Isaac Z. Schlueter. Having faced a number of frustrations on the previous project, he decided to devote himself to developing a new runtime named Deno.
A quick word about Node.js
Released in 2009, Node.js is an open-source software platform that makes it possible to develop ultra-fast applications. This is for two main reasons:
- Node.js uses Google’s V8 JavaScript engine. All the JavaScript code is then compiled into native machine code before the file is executed. That is what allows Google to interpret the code.
- Node.js is able to run several tasks simultaneously. It is built on a non-blocking operations model. It is therefore entirely possible for the runtime to execute a second task while the first is pending or in progress.
Deno, the new project
In a talk given by Ryan Dahl on “10 things I regret about Node.js”, he announced in 2018 the launch of a new project he had named Deno (an anagram of Node). He states that Deno is not intended to replace Node, and yet the two projects are similar in several respects.
Deno and Node, similar projects
Deno makes it possible to run JavaScript outside a browser, just like Node, with the difference that it also supports TypeScript. Both are built with Google’s powerful, lightweight V8 JavaScript engine.
But the two runtimes are obviously not identical in every respect. As mentioned above, Ryan Dahl launched the Deno project following a few points of dissatisfaction, notably regarding security.
Deno, the improved runtime
Ryan Dahl therefore devoted a great deal of effort to the security of the Deno runtime so as not to repeat the same mistakes. From now on, no access is granted by default. Simple and effective: it is up to the developer to choose and grant access. Another advantage lies in the fact that this access can be configured as precisely as you like via command lines. Examples: --allows-net, --allows-write.
Following technological advances, the Deno runtime differs from Node in its ECMAScript module system. When Node was being developed, module systems were not yet on the agenda. On Deno, however, they can only be used by specifying their URL (example: $ npm install bootstrap). All the same, ES modules are a real advantage for Deno. They allow the runtime to run server-side with JavaScript but also to be hosted on any web server, even outside NPM.
To interact with any operating system, Deno can rely on the Rust language as well as on TypeScript without needing any special configuration.
The only major feature the project is still missing before it can be released is debugger support, which should use Chrome DevTools for debugging.
A change of approach from the creator
In creating the Deno runtime, Ryan Dahl above all changed the way he thinks. His regrets with Node were about not having considered the project as a whole; he focused on what he thought was the right thing to do without listening to what his team was telling him. He says so himself: his friends had often made recommendations to him but he did not take them into account. He later realised his mistakes — unfortunately too late to make up for them. Today we can see that the creator knows how to learn from his past mistakes. With Deno, he is doing everything he can to start from the definition of the project’s needs and thereby avoid losing his way along the road.
To conclude, Ryan Dahl has announced that Deno will not be compatible with Node. That is a deliberate choice on the creator’s part, and he will not attempt anything to make the two projects compatible. In this way, he wants to avoid any possibility of recreating the same runtime.
You can see the official documentation at deno.land, and if you found this article interesting, do take a look at the Numendo blog.