“I have only one learning technique: projects that I’m working on” — interview with Ryan Dahl

HolyJS
20 min readMay 7, 2019

--

May 25th will mark 10 years since the original release of Node.js. During that decade the project created by Ryan Dahl has achieved a lot. But Ryan himself has moved on to other things. What are those things? And what are Ryan’s views on languages, education and conferences?

On May 23th, two days prior to the anniversary, Ryan will present a talk on HolyJS conference in Saint Petersburg, Russia. In anticipation of that, HolyJS program committee members Dmitry Makhnev and Evgeniy Kot asked him a lot of questions.

Eugene: Most JavaScript developers know you, but for those who don’t, could you please tell a bit about yourself?

Ryan: I come from San Diego, California. I studied mathematics in undergraduate and in grad school. I was in a PhD program for algebraic topology at the University of Rochester. Three years into that I thought to myself: “What am I doing with my life? This is too weird and abstract”. I promptly dropped out of that program, ended up travelling around for a while and fell into programming, like many people do. I got into web development in mid-2000s. At the time I was quite into Ruby on Rails and Ruby in general. I was working on contract for EngineYard supporting their customers and later developing a NGINX module, which had me thinking a lot about non-blocking I/O, which lead led in early 2009, to the Node project.

Eugene: Was it just luck? Or did you have some vision of the future where Node would be super-successful?

Ryan: Why would you work on something if you don’t think it’s going to be successful? Most of the time you work on a project and it doesn’t work out. Eventually you give up on the project for whatever reason (and this, of course, has happened to me in all cases but one). Certainly Node was a case of the right timing. Chrome has just come out (and with it the new V8 VM), and I was thinking about non-blocking IO and how that could be exposed to web frameworks, and that all happened to fit really well with JavaScript. So yeah, it was just absolute luck.

Eugene: Currently you are working on Deno. What’s your work right now? What are your future plans?

Ryan: I’m trying to do a startup with a long time collaborator of mine, Bert Belder. We’ve been working on several projects during the last year and a half or so, one of them being Deno. Bert was very central to the development of Node, he did much of the heavy lifting required to port Node to Windows. He’s also one of the main authors of Libuv, which is the platform abstraction backend of Node.

Eugene: Do you think that Deno will also become super successful and you will continue working on it in five years?

Ryan: Whether it’s going to survive for five years I have no idea. Probably not, because most things fail. But it excites me and I enjoy working on it.

I guess I’m unsatisfied with the state of dynamic languages. I find myself wanting to have a quick go-to tool that I can deploy in various situations. Node and Python are good, but I find them unnecessarily complex or poorly designed in various ways. So this is about developing a tool that fits my own workflow, or the workflow that I want to have.

Eugene: While preparing for this interview, we read another good interview with you by Mapping the Journey. You told there that you were doing a project related to machine learning. And later at JSConf EU you presented Deno. So did you move from machine learning to Deno? What was your plan or your path?

Ryan: I’ve been toying around with ML algorithms for the last couple of years and I was the middle of some project — essentially a framework for doing ML in JavaScript. It was the first time I had been using Node for a few years, and it clarified some of the issues that I had with it. So that led to a side project with a prototype in that presentation at JSConf EU. I got a lot of interest in the project after I presented it, so Bert joined and we just kept working on it. I will get back to these ML projects eventually.

In particular, I’d really like to hook up Deno to WebGL. Deno, of course, is built on top of V8, which is part of Chrome, and Chrome is a whole world of software infrastructure. Within Chrome there’s a library called Angle, which implements WebGL. Binding to this would allow Deno to program GPUs. GPUs are necessary for training many modern neural network models. I’d very much like Deno to satisfy the workflow I want for doing mathematical programming. I believe that a lot of the problems one works on in statistics (or mathematics in general) is plotting data and I think that a dynamic language is super useful for that.

There’s not that many dynamic languages in the world, especially among popular ones and fast ones. So it seems like JavaScript would be a great language for defining models. In many cases computation will be offloaded to a GPU. The actual speed of the dynamic language, or the runtime that you’re in, isn’t necessarily so important because of this. So yeah, I plan to get back to that stuff, but currently I’m distracted with Deno.

Dmitry: Cool. And is Deno production ready or not? Can I use it?

Ryan: I would say different people have different tolerances for pain, and for certain people who are willing to deal with bugs and lack of documentation and changing APIs, Deno could be useful for certain use cases. But in general — no, it is not ready for production. It’s version 0.3 right now, and I will label it 1.0 when I think that other people should use it. So no, it’s very much in development. It’s a fairly large undertaking. We’re essentially building a new platform. There’s a lot of things that go into this, and we’re trying to do this properly. That said, it’s somewhat usable for the hacker types out there who don’t mind getting dirt on their hands and maybe submitting an issue or PR when they hit problems.

Eugene: What has to be added to Deno in order to start using it in production?

Ryan: I think we’re trying to target a bit of a different use case than Node has. Node is a program that you run on your computer, right? One of the things that we’re trying to do is make Deno have more lower-level access to it. In particular to be able to import it as a Rust crate in particular, and embed it into other systems.

Suppose that you had your own web server of some sort, maybe some sort of serverless setup, and you want to give your customers the ability to execute a little bit of JavaScript, right? Maybe you don’t want to go so low as just raw V8, because raw V8 doesn’t give you that much. Maybe you want to be able to import from URLs, you want a bit of infrastructure around this, but you don’t want to go all the way towards the full runtime that somebody might have on a desktop computer. We hope that we can target this “embedding” use-case. We’re still working on how exactly that API looks. We also have some performance problems that we need to deal with which we track. We need to provide better documentation. So, yeah, there’s a lot to do still.

Dmitry: One of the goals of Deno is to support TypeScript out of the box. Many people use TypeScript, and not only for browser stuff, but for Node.js, too. And I heard that some people from Node.js core team said that it’s good, and that TypeScript is the best language for transpiling for Node.js. Do you think TypeScript can replace JavaScript someday in the browser and have its own runtime, maybe with some VM?

Ryan: The nice thing about TypeScript is that it’s a superset of JavaScript, it wouldn’t replace JavaScript. What I could see potentially happening — although this would be a very long time away — is that TypeScript gets added to the standards and JavaScript gets optional types.

Dynamic languages are very useful for the initial phase of development, like when you’re prototyping something. The nice thing about TypeScript (and the idea of optional types in general) is that as that prototype slowly matures, you can ratchet down the implementation by annotating the code with types. It doesn’t have to happen all at once, so you still have the ability to move very fast and sketch out new ideas in JavaScript.

As to whether the types can be used inside the V8 VM for runtime optimization, I don’t know. It sounds very hard and I don’t have the experience to know if there are potential wins there. In Deno we use the TypeScript compiler, which is implemented in JavaScript. One could imagine potentially having a Rust implementation of the TypeScript compiler, which could transpile to JavaScript faster. That may be possible. There’s a project called SWC that is working on that.

Eugene: But do you think TypeScript can completely replace JavaScript?

Ryan: What would that mean?

Eugene: There are different scenarios. For example, combining TypeScript with JavaScript in ES 2020, so it would be one language and one standard.

Ryan: Yes, I could see there being types added to the standards. TC 39 controls the JavaScript standard, I could see them taking up types. From what I hear that has not been seriously considered yet. But think it will be a very long time before that happens — maybe some day.

Eugene: A personal question from me: what do you think of Dart? Have you used it?

Ryan: I’ve played around with it a very long time ago. Dart has similar goals to TypeScript, it was built with this optional typing idea. Which is a really nice workflow, as I said. But they chose a route of defining a different language, Dart is not a superset of JavaScript. Because of that, maybe, it hasn’t had the best adoption curve.

Flutter is doing quite well these days, so maybe I have to revise my ideas, but I would say that generally TypeScript has succeeded in these goals of having an optionally typed language by just extending JavaScript, rather than going in the direction of building your own language.

Whenever somebody proposes a new language, it’s really hard to get people to adopt it. It needs to be a lot better. For the longest time I thought this about Rust: I’m an avid C++ user, so I was like “What would Rust give me that C++ doesn’t?” I’ve learned about Rust recently, and actually it gives you a lot, it’s super useful. Adds a ton to C++ and as far as I’m concerned, essentially replaces C++. New languages need to provide something vastly better in order for them to succeed.

Eugene: Yeah, languages are like cars: everybody can try it, but will still use the bus sometimes.

Ryan: Yes, exactly.

Eugene: TypeScript is popular these days, but JavaScript is everywhere: backend, frontend, mobile, React Native, small devices like Raspberry Pi, all those things. So it looks like a revolution has already happened, we have one language for everything. Do you agree with that? Or will there always be special languages for special needs?

Ryan: This is why JavaScript is interesting: because it’s a language that runs everywhere. I would note that a lot of people think of TypeScript as a separate language, but it’s not, it compiles to JavaScript within JavaScript, it’s very much JavaScript. So as far as I’m concerned, TypeScript runs everywhere too. So yes, I believe in this idea. Certainly JavaScript will continue to run in the web browsers into the foreseeable future, and on various devices. That’s exciting, because you can target many different applications with it. That’s why I want to use JavaScript.

Dmitry: Do you think this popularity of JavaScript is good or not? These days web is the necessary platform for any service, and JavaScript is the only one language for that. Maybe we need to have a choice? Maybe we need to put different VMs into browsers to have some options?

Ryan: Well, I think that’s why people are excited about Wasm. This gives you the ability to compile, for example Rust, into something that can execute in browsers. That would be very awesome, but I wonder how well this will work for languages with garbage collection or other runtime facilities. While it might be possible to use, say, Python via Wasm to program a website, I suspect it will be quite unwieldy and slow. I guess we’ll have to wait and see how it turns out.

Dmitry: And if I want something different from JavaScript, I need to learn something that can transpile to Wasm, yes?

Ryan: Or transpile to JavaScript. The thing is that the JavaScript has a garbage collector and whatnot, and so if you have a dynamic language it probably makes more sense to transpile to JavaScript than it does to compile to Wasm and then also compile your entire runtime, including your garbage collector and stuff. Then you have a lot of overhead, while V8 is probably going to do a better job at garbage collection, no doubt. But yes, Dart compiles to JavaScript and you can use that to write websites. And there’s a couple of other languages that do that as well.

Dmitry: Speaking of languages, what new or old languages would you find interesting to learn in 2019?

Ryan: I really love Rust, it’s great. Rust has some new ideas in it, in particular this idea of having a single mutable object. Its compiler is very good, so you get extremely optimized code. It is an extremely steep learning curve though. It took me a couple of months to wrap my head around what was going on there. So I think Rust is super interesting, but it’s also something that I wouldn’t imagine is going to be used by everybody for everything.

If you’re writing an app, you probably are not going to be using Rust. If you’re writing business logic, you probably want to be doing this in the easiest possible language — Ruby, JavaScript or Python. Only in particular use cases would you really want to reach for Rust. But in those use cases it’s going to be super useful. If you’re writing a database or a web server — it’s a great language to choose. Or a VM, like we are. It gives you 100% control over what’s happening in your code at the expense of a lot of complexity that is exposed to the programmer.

It’s really a game changer for native code and offers something over Go. Go has a garbage collector, so I think Go is really great for high-performance servers, it’s super clean, very easy to write. But there’s still a couple of use cases where having a garbage collector is not appropriate. Like in Deno, for example. We’re wrapping V8, and V8 has a garbage collector. So using Go with V8 is fishy. We would have two garbage collectors in the same process which potentially could interact in catastrophic ways. V8 is already a monstrosity of complexity, that’s enough. So for our use case Rust is great. And I think we’ll see some interesting applications with Rust compiling to Wasm in the future.

Eugene: And what do you think about functional programming, functional languages?

Ryan: I think the functional style is good. I don’t think that you necessarily have to have your entire language structured as a series of maps and reduces and whatnot. I think there are certainly cases where imperative style programming is much easier to read and works out very well. Rust and JavaScript are great examples of merging these two styles of things. So I don’t think it’s an exclusive “either-or” situation. In the end CPUs are imperative, it’s a series of instructions that get sent to the CPU, so in many ways it makes sense to think about things sequentially like that.

Eugene: And what paradigm or style is Deno written in? Object-oriented or functional?

Ryan: Both. It depends on the various parts of the program and what we’re trying to accomplish.

Eugene: We talked about languages, and what are your favorite tools for writing code? E. g. what is your preferred IDE, terminal, OS?

Ryan: I use vim, iTerm2, and yes, I have a MacBook, a small, 11–12 inch laptop. I travel a lot and work out of various places, and I’ve just noticed that if I have a big screen, I get very used to having a big monitor, and switching to the laptop becomes really painful. So I’ve just trained myself to work off of a laptop. In terms of tooling I have a Linux box at home that I SSH into. I’m relatively old-school when it comes to tooling, it’s UNIX-y stuff. I use LLDB for debugging.

I’ve tried Visual Studio Code, but we’re writing our own platform, and a lot of the integrations that you expect to happen with IDEs are not there. Usually these are superficial problems not related to what I’m working on, and I find it to be a distraction. I’m used to seeing this very bare-bones thing, and I think that works better for developing low-level software. I guess if I was working on a website or app in some established platform I would probably use Visual Studio Code.

Eugene: So you’re an old school programmer.

Ryan: I guess so, yes.

Eugene: The next question is related to this topic — it’s about new school, if you wish. It seems like basic programming skills right now or in the near future will be as necessary as math or English or something else everyone studies in the school. What do you think about that? Maybe in a slightly more distant future machine learning will become a necessary skill?

Ryan: In the last 15 years that I’ve been doing programming I’ve been surprised at how much bigger it has become. I felt like I was late to the game in 2005, but looking back on that, it was a much smaller community of people. Now it seems like everybody is a programmer. It’s very clear that programming has been scaled to a much larger audience. It is a useful skill for a large number of people. Given that, yes, people should be learning this in high school. As for machine learning, it’s quite technical and I would think high school students would have more fundamental knowledge to worry about.

I do think is that statistics should be taught more in lower level mathematics. At least in the US when you are in high school, you learn a lot of algebra, the quadratic formula, you’re taught low-level calculus, taking derivatives, this sort of stuff. Algebra and calculus take up the bulk the course work, whereas quite a small segment of the population ends up using those skills often. But being able to process data statistically is a skill many more professionals need to have.

Machine learning itself, especially deep learning, is changing very fast, it’s very much under development. Who knows if it’s going to be the same thing in ten years as it is now. Probably not.

Eugene: I have another question related to the new generation. We had a bunch of people from school in our office a week ago. I talked to these kids who are 15 years old, and one of them told me he tried Python and Rust. You said that you felt you were too late for the train in 2005, but we have a feeling that the young generation can probably learn faster than us. My friends have a child who is about three years old, and he already knows how to enter something in YouTube, how to play games in a device. I’m starting to feel too old.

Ryan: Yeah, me too.

Eugene: Do you have a feeling that we are too old for this? That we will be too stupid for the next generation?

Ryan: Probably every generation has thought this. I’m sure that when we were kids people thought the same thing about our generation. But yeah, YouTube is really a game changer. It’s just amazing that you can just decide: “I want to learn physics!” and just watch the best physics lectures that have ever existed. There’s just so much opportunities for self-teaching now. I think kids are going to be very smart. It just allows people to go after what they are looking for. I remember being a kid and wanting to know something. We had this set of encyclopedia books at home, so you would just look inside it, and if it wasn’t there that was it, there was no way to know, no answer to the question that I had. That’s not the case anymore.

Dmitry: In our industry we need to learn continuously through articles, books etc. How do you do that? Can you suggest something for old people such as ourselves?

Ryan: I think it’s the same anywhere — it’s hard to keep up with technical subjects that are moving really fast, and I don’t have any special advice for that. One has to just keep doing it. I always tell people that you have to have a project, you can’t learn things in the abstract. It’s very difficult to learn something in detail if you’re not actually working with it. I can’t tell somebody about Rust and then they would know Rust. You have to actually use it yourself. The only technique that I have, which is not really a technique, is that I always have projects that I’m working on.

Dmitry: Maybe you can suggest how I can check the results of my side project? E. g. I get Rust, I write something in Rust, and I want to talk to somebody about it, but none of my colleagues use it. What would you suggest?

Ryan: I don’t know. Find some friends online?

Eugene: Yes, but let’s imagine I started a side project in a completely new language, the technology is completely new to me. I think my code in Rust would be awful. How to improve upon it? Just improve the project, pull request, all those things? How to become better with some technology that you don’t know?

Ryan: I can’t offer any advice, I have no idea. I wouldn’t claim to be very good at these particular things.

Eugene: Well, we’re lucky, because we have so many ways to learn. You mentioned YouTube, and we have other media, blog posts and all those things. Which ones do you like? Maybe you use YouTube videos? What do you think about conferences?

Ryan: I think conferences are great. As far as programming is concerned, I don’t use YouTube at all for that. I read Hacker News and some Reddits. I generally keep up to date that way, but not really. I generally just work on projects, and I’m sure I’m missing out on a whole slew of interesting technology. The programming YouTube world seems a little too newbie for my tastes. I don’t know, I would dig into documentation. But for other topics that I’m not an expert in, like physics, which I’m interested in, YouTube is really great.

Eugene: And what about conferences? What, in your opinion, is the main reason for attending them?

Ryan: Conferences are super useful, I love attending them. I should say, it’s worked for me. Especially if it’s a JavaScript conference, there’s always a bunch of people in there talking to me a bit. But yes, this is the best way to get introduced to new technology. You hear an interesting talk, go have a beer with somebody, they tell you about it, and they are excited about it. This is how I actually get most interesting things — hearing about it from people in person, and generally just hallway discussions about projects that aren’t public yet, what’s going on. It’s exciting and fun. So I’m really looking forward to coming out to HolyJS. How long have you guys been doing this now?

Dmitry: It started in 2016.

Eugene: In the interview that we mentioned earlier you said that you worked on NodeJS for about four years. That’s a lot of time. How did you combine it with your main job? Was it more of a hobby? Do you have a side project right now?

Ryan: With Node it started out as a side project. I was freelancing, but after a while I got hired by Joyent. They basically told me: keep working on this, we like what you are doing. That’s how Node worked out. Whether I have side projects at the moment? I have a lot of non-programming things that I’m interested in, but at the moment Deno takes up all of my time. It’s quite a big project. I have kind of side projects within Deno.

Eugene: If it’s not too personal a question, what hobbies do you have apart from programming?

Ryan: I’m toying with the idea of getting into physics a bit more seriously. I find this stuff quite interesting. But I’m totally a layperson, I hear stories about it, but I haven’t actually studied it as a grad student. I’m also quite interested in machining, I guess you would call it metalworking. I have no experience with this whatsoever, but I find it fascinating how people can make these very strong machines somehow. I guess I’m fascinated by that because it’s very similar to software engineering, but in the physical realm. You’re problem-solving, you have to design things, use one tool to build another tool, make precise measurements, that sort of stuff. It’s a physical manifestation of software.

Eugene: You mean, like put V8 into Volkswagen Beetle?

Ryan: Yeah, exactly.

Eugene: So it’s something related to V8, again.

Ryan: Yes. I mean, I’m just an amateur, I don’t know anything about this stuff. I just like reading about these things. I would consider myself also an amateur in the machine learning world. I’ve done a bit of research, but by no means am I a PhD level person. So I would like to get back into that. There are some topics in the machine learning world that I would like to pursue further, but at the moment I’m a bit too busy to do that.

Eugene: Let’s talk about open source. Is it worth it for a developer to write open source software? We mostly do it for fun, but as you mentioned, when we start a side project, we always want it to be successful. Is it worth it for you?

Ryan: It’s absolutely worth it for me. I’ve spent my whole career working in open source, so I think it’s great. I think you make really good relationships and long lasting friendships with people across the world. It’s fun. Now that the tech industry has become so massive, and people have negative feelings about Facebook and Google and whatnot, this isn’t thought about as much. But I still believe in the idea of open source, this Richard Stallman-type idea that we’re building a better world. This is free software, and anybody can go and take it, do what they want with it. This allows people to not have to pay a huge amount of money to get access to cool technology. It’s still a driving ideal for me.

Eugene: Ten years ago there were fewer people in IT industry and programming, today it’s an industry with a lot of newcomers. Do you have a feeling that it was like a private club for some people who love it? And right now the industry is more like just a job, with marketing and everything.

Ryan: I wouldn’t say that it was a private club back in the day. Rather a public club, anybody was welcome to join. These days sometimes I get into a project and it starts feeling like work. I’m sure you have this experience. Maybe it is actually work. I just try not to do projects that I don’t get excited about. If it starts feeling like work, I just do something else. That keeps you doing exciting things.

Eugene: Actually, it’s really motivating. Let’s talk some more about the conferences. Of course, it’s a public club, and the conference is the best way to join this club. Even if you don’t know programming, you attend a conference and listen to the talks. What are the most important things in conferences for you?

Ryan: Technical talks. For myself, that’s the most interesting thing. I love hearing about some new technologies and people getting into details about those technologies. And the side chats that come after the talk, that’s good.

Eugene: And the final question. As far as I understand, this is you first time in Russia?

Ryan: That’s correct. I’m really excited.

Eugene: What do you expect from the country, from the city, from the conference?

Ryan: Well, I have this idea of Russian programmers, that you guys are extremely hardcore. I have this one friend who is extremely good and very Russian. Maybe my experience is tainted by him. So I’m expecting some hardcore Russian hackers out there. As for the city, I hear St. Petersburg is very beautiful, so I look forward to seeing that.

Eugene: We’re excited too, because you’ll be talking on the HolyJS 2019 in St. Petersburg. Thank you very much for your time, it was a pleasure.

Ryan: Thanks, this was fun. I look forward to coming out there.

We also published a Russian translation of the interview.

--

--