538

November 18th, 2022 × #javascript#nodejs#deno#typescript

Supper Club × Ryan Dahl and Deno

Ryan Dahl discusses the origins and goals of Deno, his new JavaScript/TypeScript runtime, and why he believes JavaScript will remain the language of the web.

or
Topic 0 00:37

Wes introduces the podcast with Ryan Dahl

Wes Bos

Welcome to Syndax, the podcast with the tastiest web development treats out there. Today, we've got a very Exciting episode for you. We have Ryan Dahl on who is probably no creator of Node. Js and most recently creator of Dino. We've been And a whole lot about Dino on this podcast, so pretty stoked to have him on.

Wes Bos

My name is Wes Bos. I'm a developer from Canada. With me as always is mister Scott Talinski. Ski, you know about Scott. Hey. Ryan, thanks so much for coming on. Hello.

Topic 1 01:05

Wes and Ryan talk about Node's early days

Wes Bos

Glad to be here. Today, we're sponsored by 3 awesome company. Gatsby, the fastest Front end for the headless web. Sentry, error exception of performance tracking, insanity, the structured content that powers remarkable digital experiences. We'll talk about all of them partway through the episode. I so I'm I'm doing a little bit of a fanboy moment now because I honestly owe A large amount of my career to you because I remember sitting this was, what, probably 12, 13 years ago, I watched It's your 2009 JSConf talk and explaining this server side JavaScript thing, and everybody's like, what the heck? What is this? And I didn't I don't think I totally understood what it was, but I was like, I'm gonna keep tabs on this node thing. And here we are, what, 13 years later, and it's a good chunk of my career.

Guest 3

Yeah. So yeah. Yeah. I think there's a lot of people who watch that from the PHP world at this at the time being like, well, why would I use this instead of PHP? And, like, yeah. Sure enough. Yeah. Many years later, that's all we do.

Guest 2

There there was there was one early talk that I gave at a, a PHP meetup in San Francisco.

Guest 2

And I I think, yeah, Node Node really really was, like, an, nice alternative for for those coming from PHP in in Kind of

Wes Bos

2010, 2011 era. Yeah. It definitely was. And it's funny because I was I was at a point in my career where, like, I didn't really have any of the problems in my programming career that you were talking about solving, but, like, I was on board.

Topic 2 02:37

Ryan discusses why he still believes in JavaScript

Wes Bos

So I'm gonna start I'm gonna start with this question, and we'll get into what Deno is and everything like this. But, so you obviously created Node. Js. You are Very smart guy. Know a lot about programming languages in general. I've I've listened to you talk about a lot of stuff. Why all these year late Liz years later, why are you still betting on JavaScript? Why is JavaScript still the language to build for for the web? It's it's a good question. I I I you know, if if you think about it, like, around the year

Topic 3 03:05

Ryan talks about the uncertain future of web in 2012

Guest 2

2012 or so. It wasn't super clear that the web was going to be what it is Today, right, mobile mobile apps were coming out, and it was kind of like there is there is kind of a, you know, uncertainty in the air that that, Oh, actually, maybe, you know, Wikipedia is just going to be a iPhone app, and we you know, somehow maybe we're This was just a a little thing that happened in in kind of the late nineties and and 2000, and web browsers would go away. But I think here in in, 2022, I you know, it's it's it's ever more clear that, like, the web is the medium of Human communication.

Guest 2

Right? Like, there's web interfaces to your bank. There's web interfaces to The government there's web interfaces to social media, obviously.

Guest 2

We we interact through the web we're talking through the web right now.

Topic 4 04:06

Ryan says JavaScript will still be here in 5-20 years

Guest 2

And, because of that, I I think it's it's fair to say that, you know, web browsers and web technology is going to be here 5 years from now, if Not 10 or even 20 years from now. And because of that, like the protocols that make up the web, the specifications, that is HTTP, CSS, HTML, and JavaScript will still be here, 5, 10, 20 years from now. And so I I think in in a very real sense, JavaScript has become the default programming language.

Topic 5 04:39

Ryan calls JS the default programming language

Guest 2

It's Weird, and it's not what anyone would sit down to design if if you were trying to make something beautiful. But that's also what makes it interesting too. I mean, it's it's this kind of organic thing that has grown out of, early beginnings and and kind of un unclear circumstances into the thing that that is is powering, human communication right now. And, it's just exciting to see all of the development and things that you can do with it. And, Of course, the the large developer base of people who who know essentially every programmer, you know, whether you're you're, like, a hardcore back end person or or or not. I mean, you you all everybody knows JavaScript to some degree. Right? And I I think that's that's pretty exciting, and and so I think, there's There's still there's still more to do there. Let's talk let's talk about Deno. So explain to us

Wes Bos

what it is. Why did you make Deno? Why not Node. Js, you already made 1 JavaScript framework.

Topic 6 05:38

Wes asks Ryan why he made Deno

Wes Bos

Why another one? A runtime, I guess. Yeah. Yeah.

Guest 2

So I I think Around 2015 or so, Node has been handed off in into the Lenox Foundation, and is is managed as, a nonprofit.

Topic 7 05:49

Ryan talks about handing off Node to Linux Foundation

Guest 2

Node has is this big c plus plus code base that's, is having difficult kind of keeping up with the changing times. Like JavaScript as as a whole is kinda moving forward with breakneck speed. And and, I mean, in particular, changes like ECMAScript modules and TypeScript are becoming part of of the day to day, usage of of JavaScript. And Node is just not moving. It's it's it's very slow and, not really incentivized to to to, make major changes there.

Topic 8 06:40

Ryan says Rust has replaced C++

Guest 2

At the same time, in in kind of the the The native language front is is developing, quite quite rapidly. And in particular, like, Rust has has essentially, in my mind, replaced c plus plus.

Wes Bos

And there yeah. No kidding. It seems like every day, we have a new Rust library come out. This thing is built in Rust, and it's a 1000000 times faster.

Topic 9 06:54

Wes agrees on Rust hype

Guest 2

I I mean, I I you know, Rust is no faster than c plus plus, but but, you know, what's nice is that it you can build larger projects with it. It's it scales better.

Topic 10 07:13

Ryan praises Rust's architecture

Guest 2

You're you have the ability to combine different rust crates much more easily than you can different, c plus plus projects and and hacking together, CMake.

Guest 2

So there there there seems to be a lot more to do with with, server side JavaScript, and And kind of moving to ECMAScript modules, moving to TypeScript, trying to be more secure. I've always regretted what what happened with With Node not really using the JavaScript sandbox as it as it was as a security mechanism.

Topic 11 07:48

Ryan regrets lack of security in Node

Guest 2

And you've seen all of these these exploits that are happening with With, Left Pad and and various other, NPM modules that that you know, just basically supply chain attacks Because node is has no security guarantees.

Guest 2

And, yeah, we we really Started playing around with with Deno as an experiment to kind of look at what what a node 2.0 would would, would look like.

Topic 12 08:06

Deno started as Node 2.0 experiment

Guest 2

And lo and behold, lots of people were interested and and were contributing, and and we we started working on it more. And, Yeah.

Topic 13 08:16

Goals of Deno

Guest 2

It's it's, it's it's it's now been a couple of years. But our our main goal with with Deno is is To make it the the easiest, the fastest, and the most secure, server signed JavaScript runtime.

Topic 14 08:39

Scott asks about Deno's bet on TypeScript

Guest 3

Nice. And so, obviously, there was, like, a big bet on TypeScript here to say, This is the way that we're we're going to write JavaScript is through through TypeScript.

Guest 3

And and TypeScript is largely could become, like, the way to write JavaScript, at least in the past couple of years here, where you hardly see people working without it nowadays.

Topic 15 08:48

Scott says TS is how we write JS now

Guest 3

Well, maybe not In the big picture, but Yeah. You're gonna make a couple of people mad with that guy, Scott, in in small in a small capacity here. But What what are your thoughts on, you know, how TypeScript fits into this landscape here given the fact that it's what is it? Microsoft owned.

Guest 3

Should types be added to JavaScript? Is is TypeScript going to become just straight up JavaScript? Like, what what are your thoughts there? Yeah. I I I see TypeScript as essentially

Topic 16 09:16

Wes asks Ryan's thoughts on TypeScript

Guest 2

JavaScript 2 point o. I mean, it's it I think the the the the TypeScript team did an amazing job where they could have done any they they have a full compiler, So they could have done anything, but they were very restrained in only extending JavaScript to add types onto it.

Topic 17 09:41

Ryan praises conservative design of TS

Guest 2

And that's That's a very nice design because that means that you can strip the types away with with a very fast compiler pass and get raw JavaScript out of it. So Now we're seeing these proposals in TC 39.

Topic 18 09:54

Ryan discusses adding types to JS spec

Guest 2

Only stage 1 right now, but types as comments, which essentially would allow web browsers To natively consume TypeScript, and strip out those types essentially. You know, the the colon type part part of of The of the syntax would just be, ignored as a comment. Of course, the web browser wouldn't do the type checking itself. But, I I I think this is the direction that the language is going. It's going to take quite a while, and it's unclear if, like, exactly TypeScript is what it's going to look like. Yeah. Like, maybe maybe there'll be some more iteration there, but it it's something very similar to this for sure. I think we're we're narrowing in on this. It's just clear that that TypeScript allows you to build, more robust applications. Right? You you can just link together bigger chunks of Code more more sanely. Is it gonna be a CoffeeScript

Wes Bos

revival? Yeah. Maybe CoffeeScript's gonna come back.

Topic 19 10:49

Wes jokes about CoffeeScript revival

Guest 2

I I think not. The the The, sig the the indentation stuff in in CoffeeScript is a little sus in in my opinion.

Topic 20 10:52

Ryan dislikes CoffeeScript syntax

Wes Bos

Yeah. Yeah. So do you think the the TypeScript thing will ever be a browser thing, or do you think it's always just gonna be, like, a author time and it gets stripped? Either the browser strips it out as comments or it's a compile step. Yeah. The type checking algorithm itself is,

Topic 21 11:18

Ryan doesn't think browsers will do type checking

Guest 2

very Inherently slow because you kind of have to traverse this big graph of of all of the the the objects.

Topic 22 11:27

Ryan thinks browsers will support TS comments

Guest 2

So I I don't think the browser will ever do the type checking, but but I think the browser will do the type scripting. It's going to take 5 years Or so to to actually get that in place. But but, yes, I I I think there's a lot of support for for that future. Okay. So another question about Dino. Like, how do you how do you make a JavaScript runtime? Do you just go download a a copy of Chrome and rip out the v eight from it? And, like,

Wes Bos

How come how come you can make Deno so much faster than than Node is? So yeah. I mean, we we

Topic 23 11:52

Wes asks how Deno is made

Guest 2

I'm I'm a I'm a VA expert. Right? I've been working on with this for for for many years now. And and my cofounder, Bert, also is is, is a early node developer. So So, yeah, we we know how to use v eight. And, Yeah. It's essentially ripping ripping it out of of chrome, although, you know, with lots of Lots of caveats to to that.

Topic 24 12:22

Ryan talks about Deno's async runtime

Guest 2

I I you know, the the way that we make it faster is is with a better async runtime. So in Rust, we're using something called Tokyo.

Topic 25 12:31

Deno uses Tokio instead of libuv

Guest 2

It's a it's a async event loop, that is similar to our earlier work, Libuv that we wrote for for Node.

Topic 26 12:41

Ryan optimized binding JS to native code

Guest 2

We we are just very careful at how we we are kind of binding JavaScript to native code and put a lot of time into into optimizing that.

Guest 2

So what's what's Kind of fun is is, Deno Deno now is supporting NPM modules. And so if you, you can take The basic, say, express server example, and, run that in in Deno, just just with, Import npm colon express.

Topic 27 13:14

Ryan talks about benchmarking Deno vs Node

Guest 2

And you can you can try to benchmark that in in node and and, you know, and and,

Share

Play / pause the audio
Minimize / expand the player
Mute / unmute the audio
Seek backward 30 seconds
Seek forward 30 seconds
Increase playback rate
Decrease playback rate
Show / hide this window