The fellow behind Node.js and Deno, Ryan Dahl, has an interesting take on the whole JavaScript scene since he's had such a big hand in shaping it. In a recent chat, he opened up about what he sees for the future of JavaScript, stressing the importance of sticking to web standards, the role of TypeScript, and how we need a more connected ecosystem. So, let's check out the main points of his vision:
The Web Browser is the North Star
Dahl's main philosophy is that the future of JavaScript is totally connected to the browser. He thinks that straying from browser standards just leads to more tech issues later on. This is a big deal that he believes was overlooked when they were building Node.js, where the module system and other stuff went off track from web standards. The ultimate standard for JavaScript, in his view, is the browser. Server-side JavaScript ought to be as close to it as possible.
- ESM is the Way: So, Dahl is completely sold on ECMAScript Modules (ESM) and feels it's high time we do away with CommonJS. According to him, using anything else but ESM is like "working against the specification." Though Deno lets you import CommonJS modules for backward compatibility, it's not really the best way for developers who are building new apps.
- No More Reinventing the Wheel So, Dahl's all about making a server-side JavaScript setup that actually sticks to web standards instead of making some totally different ecosystem. So, it just means adding features super similar to what browsers provide.
Embracing TypeScript as the Natural Evolution
Dahl thinks TypeScript is the easiest way to throw types into JavaScript. He's all about how TypeScript boosts developer productivity and keeps it real. He's hoping that the push to stick type comments in JavaScript will eventually match up with TypeScript's syntax.
- Types are Fundamental: He completely agrees it's obvious that TypeScript is really convenient and this is how you add types to JavaScript, not Flow or whatever else.
- Browsers Will Eventually Catch Up: He's expecting that eventually browsers will be able to fetch TypeScript files and just strip out the types so you can run them. Deno is doing some of this already, so developers can just write straight up in TypeScript.
A United Ecosystem via JSR
Dahl worries over how npm is doing presently; he described it as the "forgotten corner of Microsoft." He believed the JavaScript ecosystem needed improvement, hence the need to start up something new that is going to change everything in its own ways - a perfect experience for publishers and consumers alike, that's JSR, a new open-source JavaScript registry.
- JSR's Objectives: So, JSR wants to be like the cool new version of npm and has stuff like autogenerated docs, a "pub score," and security features. It plays nice with Deno but also has this npm adapter so you can use it in Node.js and other places too.
- Focus on Developer Experience: JSR really cares about making it super easy to publish and use packages, especially when you're working with TypeScript.
- Centralized and Controlled: So, unlike Deno's original module system all up in the air, JSR is a centralized registry really tuned into being reliable and stable. In addition, it is much more hands-on with regards to ownership of packages, preventing squatting and making sure popular scopes stay with the right organizations.
A Focus on Practicality
Dahl's vision isn't about jumping on the latest trends; it's more about building a stable, reliable, and practical development environment. He feels like the JavaScript world has been bogged down by unnecessary complexity.
- Simplicity is Key: With Deno, he aims to provide a complete development toolkit in a single executable file, making it easier for newcomers to start. Deno offers built-in tools like code formatting, linting, and type checking, removing the need to install and configure many different tools.
- Security by Default: Deno takes the security-first approach by requiring explicit permissions for file system or network access, akin to how permissions are handled within browsers. The environment is now more secure by default.
- Standards: He really stresses how important it is to stay on the specs and not wander from them unless you have to. Although you can break the specs, he thinks the module system should certainly be in line with the standards.
- Long-Term Thinking: He believes JavaScript is "too deeply embedded in humanity" to just disappear anytime soon. This long-term view helps him make decisions about where the language is heading.
Looking Ahead
He wants JavaScript development to be the most smoothest and fun activity ever. Which is to keep the Deno runtime fine-tuned, keeping the backside support for TypeScript, and make sure that such an ecosystem works well with everything with projects like JSR; also open for collaborating with others, keeping his ears open as the community moves ahead, sort out the issue on trademark and JavaScript.
A Personal Surprise: A Reply from Ryan Dahl
After writing this blog, I decided to send an email to Ryan Dahl himself, not expecting a reply. To my surprise, he actually responded! It was an incredible and unexpected moment for me. I was thrilled to receive a reply from the creator of Node.js, and it made this entire experience even more special.
This response reaffirmed how open and engaging Ryan Dahl is with the developer community. It was truly an inspiring moment!