
“I have only one teaching method: just work” - interview with Ryan Dahl (Node.js, Deno)

May 27 will be 10 years from the moment when Ryan Dahl has released the very first version of Node.js . Over the past decade, the project has become more than successful, but Ryan himself has already switched to other things. What is he doing now? How can his new project help JavaScript developers? What does he think of different languages, education and generational change?
May 25, two days before the round date, Ryan will speak in St. Petersburg at our HolyJS conference. In the meantime, HolyJS program committee members Eugene bunopus Kot and Dmitry dmitrymakhnev Makhnev asked him in detail about all of the above. On Medium, we published an English versioninterview, and for Habr made a Russian-language option.
Eugene : Many readers already know you thanks to Node.js, but could you tell us a little about yourself?
Ryan : I come from San Diego, California. I studied mathematics at the university, and my specialty in graduate school at the University of Rochester was algebraic topology. But after three years, I thought: “What am I wasting my life on? These are too strange and abstract things. ”
Therefore, I left graduate school, went to travel, and after some time I was involved in programming. I think many have done a similar path. In the mid-2000s, I became involved in web development. At first, I liked Ruby on Rails and Ruby in general. As for Node, it’s lucky to be in the right place at the right time. Coincidentally, I was thinking about the corresponding issues just when Node became possible.
Eugene : So it was luck? Or did you have a certain vision of this project, and from the very beginning you assumed that it would be super successful?
Ryan: Will a person work on a project if he does not hope that he will be successful? Of course, most often these hopes are not met. We give up and start doing something else - as happened with all my projects except one. With Node, I was definitely lucky. Then Chrome just came out (and with it V8), and I thought a lot about non-blocking I / O and how they can be represented by web frameworks, and all this went well with JavaScript.
Eugene : Now you are doing Deno . Can you talk about current work and future plans?
Ryan : My long-time comrade Bert Belder and Itrying to create a startup. Over the past year and a half, we have worked with him on several projects, one of them is Deno. Bert played a big role in the development of Node, he did most of the work of porting Node to Windows. In addition, he is one of the authors of Libuv .

Eugene : Do you think Deno expects major success in the near future? Will you continue to work on it, say, in five years?
Ryan : I have no idea if Deno will exist in five years - most likely not, because most projects end in nothing. But for now, Deno captures me and gives me job satisfaction.
I think at the moment I am not satisfied with the state in which the dynamic languages are. I miss a quick, convenient and fairly versatile tool. Both Node and Python are good, but I find them unreasonably complex or poorly designed in some ways. So in the end, I'm trying to make a tool for my own workflow.
Eugene : While we were preparing questions, we read an interview on the Mapping the Journey website. There you said you were working with machine learning. And soon after that, they took and presented Deno at JSConf EU . So your interests have shifted?
Ryan: In recent years, I dabbled in machine learning algorithms. I won’t go into the details of the project I was working on, but it was a JavaScript machine learning framework. Because of this, I tried Node for the first time in years, and this clarified some of my problems with Node. This led to the presentation at JSConf, in which the Deno prototype was shown. Then the project showed tremendous interest, so that Bert joined. And we continued to work on it. And later I will return to those ML projects.
I especially want to connect Deno to WebGL. As you probably know, Deno runs on V8, which in turn is part of the vast world of the Chrome software infrastructure. Chrome has an Angle library that implements WebGL. Connecting to this would allow Deno to program the GPU. And GPUs are necessary for training models of many modern neural networks. I would really like Deno to provide me with the desired process of working with mathematical programming. I believe that a significant part of the tasks in statistics and mathematics as a whole come down to a kind of data games, and this is very convenient to do with dynamic languages.
Generally speaking, there are not so many dynamic languages in the world, especially when it comes to popular and fast. So JavaScript is great for defining a model. In many cases, the calculations will be transferred to the GPU, so the speed of a dynamic language or your runtime will not be so important. In general, I plan to return to all these things sooner or later, but so far my focus is on Deno.
Dmitry : Is Deno ready for use in production now? Do you know of interesting cases of real use of Deno?
Ryan: It seems to me that different people have different pain thresholds. If you are ready to live with bugs, lack of documentation and changing APIs, then for some tasks Deno can be used even today. But in general, he is not yet ready for production. It is now in version 0.3, and I will designate as 1.0 the version that I consider suitable for use by other people. This is a fairly large-scale project, we are creating a new platform. To do this, a lot of work needs to be done, and we are trying to do it properly. However, if you are a hacker, do not be afraid to get your hands dirty and leave issue or pull request in the event of a problem - then this can be used.
Eugene : What needs to be added to Deno for companies to start using it in production?
Ryan: In the case of Deno, we focus on different situations than with Node.js. We are trying to provide a lower level access to the computer. In particular, we want Deno to be able to be imported as Rust crate and that it can be embedded in other systems.
Suppose you have your own web server or serverless system, and you want to provide clients with the ability to execute JavaScript. Perhaps you do not want to go down to V8 level, a raw V8 will provide you with little. Some infrastructure is needed, but the full-blown runtime that someone on a desktop computer might have is already too much. We hope to cover this “embedding" scenario. We are still working on what the API should look like in this case. We also have performance issues for which wewatching . We need to provide better documentation. In general, there is work to do.
Dmitry : One of Deno's tasks is the built-in support for TypeScript. Recently, TypeScript has spread quite widely, many companies began to use it not only in the browser, but also for Node.js. I heard that people from Node.js core team also praised him. In your opinion, can TypeScript ever replace JavaScript in browsers and acquire its own runtime (possibly with a virtual machine)?
Ryan : One of the benefits of TypeScript is that it is a superset of JavaScript, so it won't replace it. What I can really imagine is that TypeScript will fall into standards and optional types will appear in JavaScript, but this will happen very soon.
Dynamic languages are very useful for the initial stage of development, for example, when you prototype something. The advantage of TypeScript (and the idea of optional types in general) is that as the prototype gradually ripens, you can gradually “twist” the implementation by annotating the code with types. This does not have to happen at the same time, so you can still move very fast and outline new ideas in JavaScript.
As for whether it is possible to use types in the V8 virtual machine to optimize runtime, I do not know. It sounds very difficult, and I do not have enough competence to say whether there will be a significant gain. At Deno, we use the TypeScript compiler implemented in JavaScript. You can imagine a Rust implementation of a compiler that translates to JavaScript faster. This is possible, the swc project is working on it .
Eugene : Can TypeScript replace JavaScript? Suppose, in ES 2020, TypeScript will be merged into one language with JavaScript.
Ryan: Yes, types may well be added to the standard. Does TC 39 seem to regulate JavaScript standards? As far as I know, so far this possibility has not been discussed. But I think it’s still a long time before, although it’s possible.
Eugene : Do you know Dart? Have you ever used it? What do you think of him?
Ryan : I tried it out of curiosity, but that was a long time ago. Dart's goals are similar to TypeScript - it is a dynamic language with optional types. As I said, this allows you to very conveniently organize your workflow. But, unlike TypeScript, Dart is not a superset of JavaScript, it is a different language. Perhaps because of this, it spreads much more slowly.
True, Flutter has gained some popularity now, so maybe I lagged behind life here. One way or another, TypeScript managed to achieve the same goal without creating a new language.
When a new language appears, it is easy for him to arouse curiosity, but to get people to use it is much more difficult. The benefits must be very significant. For example, I was very skeptical about Rust. It seemed to me that everything that he can do is already in C ++, which I actively use. Only recently I got to know Rust more closely, and it became clear that for me it can easily replace C ++. In general, for a new language to be successful, it needs to be an order of magnitude better than the old.
Eugene : With languages - like with cars, anyway you will sometimes ride a bus.
Ryan : Exactly.
Eugene : Despite the popularity of TypeScript, JavaScript is now generally ubiquitous: on the backend, frontend, on mobile devices, in React Native, Raspberry Pi and so on. Apparently, we have a revolution, and there is one language that can do everything. Is this really so? Or will there always be special languages for special tasks?
Ryan : JavaScript is just that interesting because it works everywhere. But it is worth noting that while many people perceive TypeScript as a separate language, it compiles in JavaScript. So, from my point of view, TypeScript also works everywhere. In general, I agree with your statement. Of course, in the foreseeable future, JavaScript will remain the language of browsers and multiple devices. Therefore, I continue to use it - it provides a very wide range of possibilities.
Dmitry : But do not you think that this popularity of JavaScript could be for the worse? The web has now become an indispensable platform for any service, and JavaScript is the only language in which you can write web services in production. Perhaps it would be better if we had a choice, and all platforms were not sharpened under one language? Perhaps we need different virtual machines in browsers?
Ryan : I think that was what caused the popularity of Wasm. On it, you can compile, say, Rust into code that can be executed in a browser.
It sounds awesome, but I wonder how well it works for languages with garbage collection or other runtime tools. Although it may be technically possible to use Python through Wasm to build a site, I suspect the result will be cumbersome and slow. I think only experience will show here.
Dmitry : That is, if I want to use something instead of JavaScript, do I need to learn a language that can be transformed into Wasm?
Ryan: Or in JavaScript. The fact is that JavaScript has a garbage collector and much more. Therefore, if you use a dynamic language, it makes more sense to translate into JavaScript than to compile in Wasm, and at the same time compile your entire runtime, including the garbage collector and more. You will have to invest a lot of resources, although the V8 will probably do better with garbage collection. But yes, Dart compiles in JavaScript, and you can write websites on it. There are other languages that do the same.

Dmitry : Since we are talking about different languages, what old or new language do you find interesting for studying in 2019?
Ryan : I really like Rust. It has many interesting finds, for example, the idea of a single mutable object. It has a great compiler that provides extremely optimized code. But understanding Rust is not easy. It took me several months to understand what was going on there. In general, Rust is a very interesting language, but by no means universal.
If you are just writing an application, then most likely you will not be writing it in Rust, but in something simpler: Ruby, JavaScript or Python. But there are some situations where Rust does its job brilliantly. For example, it is great for writing databases, web servers, or, in our case, virtual machines. It gives full control over everything that happens in your code, but at the cost of complexity, which is open to the developer.
Rust is a new word in writing low-level code; it has significant advantages over Go. Go has a garbage collector, so it is great for high-performance servers, it is concise, and writing on it is very simple. However, there are times when having a garbage collector can be a minus, not a plus. Deno, for example, has such a case. We wrap a V8 that already has a garbage collector. Two collectors in one process would turn out, and their interaction can appear catastrophic. The V8 is already monstrously complex in itself. In general, Rust is perfect for our purposes. It will be interesting to see what new applications there are for Rust when it can be compiled in Wasm.
Dmitriy: And what do you think of the growing popularity of functional languages? For example, Elm for the frontend, or Idris.
Ryan : I haven’t tried either one, so I can’t say anything about them.
Eugene : What about functional languages in general?
Ryan : The functional style is pretty good. This does not mean that the entire application should consist solely of map, reduce, and the like. There are situations where it is easier to work in an imperative style and easier to read. Both approaches are very well combined in Rust and JavaScript, so limiting yourself to just one is not necessary. Ultimately, the CPU is still imperative, it works on the instructions sent to it. Therefore, it is wise to think about code in the same paradigm.
Evgeny: And in what style is Deno written? In object oriented or functional?
Ryan : Used both. It all depends on the specific goal that we are trying to achieve.
Eugene : We have already discussed which languages you prefer, but what about the tools? What is your favorite IDE? Do you write on MacOS or Linux?
Ryan : I write in vim, use iTerm2, and my computer is a small MacBook. I travel a lot and because of this I often work on a laptop. At a certain point, I noticed that after working behind a large monitor, it is very painful for me to switch to a laptop. Therefore, I taught myself to work on a laptop all the time.
At my place is a Linux-based system unit, I am connecting to it via SSH. I'm pretty old-fashioned in choosing tools, mostly these are UNIX-like things. I am using LLDB for debugging.
I worked in Visual Studio Code, but now we are writing our own platform, so there are not many integrations that you get used to expect from the IDE. Usually such things have nothing to do with what I'm working on, and in the end, all this distracts me. I'm used to working with bare code, this is especially convenient when developing low-level software. I think if I wrote a website or application for a popular platform, I would use Visual Studio Code.
Eugene : In general, you are an old-school programmer.
Ryan : Probably yes.
Evgeny: Then the next question will be about school. Apparently, basic programming skills in the near future will be studied at school along with mathematics, English and other subjects. What do you think of it? Perhaps in a somewhat more distant future, machine learning will also enter the school curriculum?
Ryan: I have been programming for the past 15 years, and during this time our community has grown very much. In 2005, it seemed to me that I missed all the most important, although by today's standards we were still few. Now, programmers are everywhere. Obviously, programming has grown to a large audience. It has become an important skill for a large number of people. And with that in mind, yes, programming should be taught in high school. But about machine learning, I think that more fundamental things are more useful for high school students.
It seems to me that in mathematics lessons it is worth more actively studying statistics. In the USA, in high school, students go through algebra, quadratic equations, the beginning of matanalysis, derivatives, and the like. Algebra and matan occupy the bulk of the program, and then a very small part of people regularly use them. But many professionals are required to be able to process statistical data.
As for machine learning, it is still at an experimental stage. It is unlikely that in ten years everything will look the same as it is now - this area is changing too quickly.
Evgeny: Since we were talking about the younger generation, we had an excursion from school in our office about a week ago. I spoke with guys who are 15 years old, and it turned out that one of them tried Python and Rust. You were afraid you were late in 2005, but, in my opinion, the new generation is learning faster than us. My friends have a three-year-old child who already knows how to search for videos on YouTube and play games. I think I'm getting old.
Ryan : Me too.
Eugene : Do not you think that we are already too old and stupid for the new generation?
Ryan: Most likely, each generation at a certain moment thought so. Our parents thought the same way about us when we were children. But YouTube has really changed a lot. If I was suddenly interested in physics, I can see the best lectures on this subject there. The possibilities for self-education are simply endless. When I was little, we had a set of encyclopedias at home, and when I wanted to find out something, I looked for the answer in them. And if there was no answer in the encyclopedia, there was nowhere else to ask. Not so now.
Dmitry : In our industry, it is important to study all the time, read articles, books and so on. How do you deal with this? Can you advise us old people something?
Ryan: It seems to me that you need to constantly study in all the technical sectors that are developing rapidly. I can’t advise anything concrete, just practice constantly. I always say that you can’t get acquainted with the subject abstractly; you need to write a project. If I just tell someone about Rust, this does not mean that they can now write in Rust. I have only one method, and in fact it is not even a method: just work on your projects.
Dmitry : Suppose I have a project that I write in my free time - how do I evaluate my work? I can do something in Rust, but of my colleagues no one else writes on it. What would you recommend?
Ryan : I don’t even know. Meet someone on the net?
Evgeny: This is an option. But suppose I started a project in a completely unfamiliar language, my code will definitely be creepy. How to make it better? Do pull requests and things like that? How to learn to work with technology that you do not know?
Ryan : I can't advise anything here. I myself am not too strong in these things.
Eugene : We are really lucky in the sense that we have so many different ways to learn. We have already discussed YouTube, but there are many other media besides it. Do you use any of them? What do you think of conferences?
Ryan: Conferences are an extremely useful thing. As for YouTube, I don’t watch programming videos there. I read Hacker News and posts on Reddit, but the main source of information for me is still my projects. True, I am sure that because of this, many interesting technologies pass me by. But YouTube programming videos are more likely for beginners. When I need something, I open the documentation. But on topics in which I am not an expert (for example, in physics), I readily watch videos from YouTube.
Eugene : And what do you think is the main thing in conferences?
Ryan: Conferences are very useful, and I always go to them with pleasure. It so happened that I always find myself there interlocutors, especially at conferences on JavaScript. The best way to learn about new technologies is to listen to the talk, and then invite the speaker to drink beer. They usually talk with great enthusiasm about their topic. Of these conversations and discussions in the corridors, I often learn about the most interesting things, including technologies, which have not yet been officially announced. So I'm looking forward to HolyJS. How much do you already spend it?
Dmitry : The first time was in 2016 , that is, three years.
Eugene : In another interviewYou said you wrote NodeJS for four years. This is a very long period of time. How did you manage to combine the project with work? Was that your hobby? Do you have such a hobby now?
Ryan : At first it really was a hobby, but then I was invited to Joyent. By and large, they allowed me to do what I already did, they just started paying money for it. Now I am interested in a lot of things that are not related to programming, but the code I write is only for Deno, this is a very large project. True, I have some kind of subprojects inside Deno.
Eugene : And if it's not a secret, what kind of things outside of programming are you interested in?
Ryan: I’m thinking about getting to know physics better, there are a lot of interesting things there. But in this, of course, I am an amateur, especially I did not study it. I also like to read and watch a video about mechanical engineering, metalworking. Again, I myself have never done this, but it amazes me what powerful machines people manage to create. I think my interest in this is due to the similarities with programming. Of course, everything happens there in the physical world, but engineers have to solve problems in the same way, design, create tools for creating tools, make accurate measurements and so on. We can say that mechanical engineering is the physical embodiment of software ...
Eugene : It seems to put a V8 engine in a Volkswagen Beetle?
Ryan : Exactly!
Evgeny: So we are back to V8 again.
Ryan : In all these things, I'm an amateur, I don’t know anything about them, I just like to read about them. By and large, in the world of machine learning, I am also an amateur. I studied this topic a little, but not as deeply as those who defended their thesis.
Eugene : Let's talk about open source. Does it make sense for a developer to write open source software? More often than not, we write it simply because it is interesting. And yet you always want your project to be successful. Does it make sense for you to do this?
Ryan: Of course have. I have been engaged in open source projects all my career, and I really like this world. In it you can meet and make friends with great people from around the world. This aspect is now often overlooked because our industry has grown exponentially and giants like Facebook and Google have appeared in it, which cause a lot of negative things in people. But I still believe in the ideal of open source, in the ideas in the spirit of Richard Stallman - that we are building a more perfect world. This is free software that anyone can take and use as he wants. This makes complex and interesting technologies available to people, and you do not need to pay huge amounts of money for them. For me, this is still what I want to strive for.
Evgeny: Ten years ago, IT employed significantly fewer people, it was a kind of “closed club” for those who were interested in technology. Now it has turned into an industry, and there are many new people in it. Do you have the feeling that IT has become a regular job from a private club, with marketing and other things?
Ryan : I don’t think it was a “closed club” - it was completely open, everyone was welcome. Now with some projects, I really get the feeling that I'm just working. I am sure you know what I'm talking about. But I just try to avoid such projects, I stop working on them. Therefore, I do interesting things all the time.
Evgeny: Your approach motivates. I agree that programming is an open club, and conferences are the best way to get into it. Even if a person does not program himself, you can always come and listen to the report. What is most important for you at conferences?
Ryan : The technical content of the speeches. I like to go into the details of how new technologies work. And personal conversations after the reports really help.
Eugene : Last question. As I understand it, this will be your first trip to Russia?
Ryan : That's right. I look forward to it.
Eugene : What are your expectations from the country, from the city, from the conference?
Ryan: I have a stereotype that Russian programmers are very hardcore. Perhaps this is due to the fact that one of my friends is a hardcore programmer from Russia. In general, it will be interesting for me to visit you and look at your city - they say it is very beautiful.
Eugene : And we will be glad to listen to your report at the HolyJS 2019 conference in St. Petersburg. Thank you very much for your time!
Ryan : Thank you, that was great.
At HolyJS in May, Ryan will talk more about Deno: he will open the event with his performance “Deno, a new Way to JavaScript”. And besides that, there will be dozens of other reports at the conference .
Due to high demand, we closed ticket sales for personal visits, but Online tickets remain available (they give access to the online broadcast of all reports during the conference and to their videos after it). So, even if you fail to be in St. Petersburg on May 24-25, you can still watch the performances of Ryan and others.