Deno focuses on a stronger security and a superior developer experience to Node(Deno is an anagram of Node). Ryan Dahl, in his talk, mentioned several fallbacks and regrets of the design decisions with the Node.js runtime. He talk about his decisions to not use Promises for API design, using the legacy GYP building system, node_modules and package.json, leaving out file extensions, magical module resolution with index.js and breaking the sandboxed environment of V8.
At the release of the Deno prototype, Ryan aimed at achieving system call bindings through message passing with serialization tools such as Protocol Buffers and to provide command line flags for access control. Deno is also built on top of Rust at its core, while Node had C++ at its core. Unlike Node, Deno does not use the NPM package manager; instead, it loads modules by referencing URLs or file paths. The philosophy behind Deno is to serve as a productive, secure scripting environment for the modern programmer. It can be a replacement for utility scripts that may have been written in Python or Bash. Instructions for installing Deno can be found at deno.land.
How is Deno built?
Deno was initially written in Go and used Protocol Buffers for serialization between privileged (Go, with system call access) and unprivileged (V8) sides. However, Go was soon replaced with Rust due to concerns of double runtime and garbage collection pressure. Tokio is introduced in place of libuv as the asynchronous event-driven platform, and Flatbuffers is adopted for faster, “zero-copy” serialization and deserialization but later in August 2019, FlatBuffers were finally removed after publishing benchmarks that measured a significant overhead of serialization in April 2019.
A standard library, modeled after Go’s standard library, was created in November 2018 to provide extensive tools and utilities, partially solving Node.js’ dependency tree explosion problem.
The Goal of Deno is not to Replace Node.JS but Only to Offer an Alternative. -Krzysztof Piechowicz
Krzysztof Piechowicz, a Senoir Software Engineer at Adesso AG, gave his opinions about Deno as he also contributed in its development alondside 150+ developers. He gave the following highlights:
- Both platforms share the same philosophy; event-driven architecture, and asynchronous non-blocking tools to build web servers and services.
- Deno differs to Node, not in purpose, but in mechanisms. Deno uses ES modules as the default module system, whereas Node.js uses CommonJS. External dependencies are loaded using URLs similar to browsers.
- Deno has no package manager and centralized registry, its modules can be hosted everywhere on the internet.
- He also categorically stated that the goal of Deno is not to replace Node.js but to offer an alternative.
So, choosing to work on Deno over Node is solely at the interest of the developer.
This AcadeMind video will give you a deeper knowledge in its use, feature and differences and comparison to Node.js.
More Updates would definitely come up as we continue to listen for the latest news on Deno and Node.js. What do you think about Deno? Share them with us through the comment section below.