Interview with Aaron Patterson, speaker of the conference RubyRussia 2018
Hello! We continue the interview series with the speakers of the conference RubyRussia . Aaron Patterson (also 3r3r3? tenderlove
) Is a member of the Ruby core team and Rails core team, a leading software engineer in a small start-up called GitHub. Pavel Argentov talked with Aaron before his second trip to Russia.
Let's start with the standard question. What is your personal ruby story? How did you get on this train? Tell us about your achievements? Was it possible to make the world better?
dhh - PA) to make New Brilliant Fine Features. I, rather, say to myself: "Okay, let's do your wonderful Fici. You look, and really come out beautiful! "
Yes, someone has to do all the manual work. For example, your presentation at the conference will be about certain deep engineering parts of Ruby in general and Rails in particular. What is the presentation really about?
In fact, I'll talk about Ruby's insides. Until the end of the whole speech is not invented.
GC, performance, everything, life, universe, 42?
I'm thinking of talking about the garbage collector, the Ruby compilation process, and the bytecode. Basically, about bytecode in a virtual machine and how this relates to a garbage collector. About some performance improvements that I did in GC. I do not intend to talk much about Rails.
Our conference was formerly called "Rails Club". Our organizers thought, and renamed the whole project mainly because Matz stated that he never visits the conference with the word "Rails" in the title. So, now we are Ruby Russia!
So, I'll talk about the insides of Ruby!
In your opinion, what should Rails programmers do to achieve better performance in their code?
There are several strategies. First, in common words, do not do anything special. Just write your application. Run it, get customers, feedback, etc. Immediately analyze the detected bottlenecks. Never work with bottlenecks until real work with clients reveals them. If you are engaged in bottlenecks, which in fact are not such, it is a waste of time. This time could be used for new features. However, I think that many would say the same, so let's talk about what really affects performance. First, just look at the database queries that the page makes. This is the first line of defense - try to reduce the time spent on certain requests. The requests themselves - to automate and reduce. You will not believe how often we forget to just add an index. Ha! So, at least make an index in the right place.
I conduct technical interviews and imagine how people forget even about what indices are in general. Why do you need to worry about this Well, what do you say about other things that the Rubists need to know? What technical pieces should the Rubist know in order to better perform his work?
There are a couple of such pieces. The first of these, I think, is the Ruby language itself. Learn the language very carefully. The second is to understand UNIX well.
You are the first "my" speaker who says that you need to know UNIX. I personally came to Ruby from the UNIX world. I was working on Linux, FreeBSD, and tons of Perl code. I came to Ruby as one more Perl-u to do my sysadmin affairs, and only later I found out that this is also a web-language. And now, you say that you need to know UNIX. How and why?
It is important to study the POSIX standards and how they interact with the operating system, because you will encounter this as soon as you start scaling. You
should know who General Feiler is and why he is reading my file?
Haha, yes! You need to know what changes performance. Perhaps, it is not necessary to memorize this by heart, but you should know that they (system calls - PA) exist, and how to make them google, because you will necessarily collide with this economy. They will matter, because the application is deployed on a UNIX server, so you need to understand how the application will interact with the OS on which it will run. Another important point is that if you got this skill on UNIX, you can apply them, for example, in other languages. If there are any problems, you can always start from this point. This is perhaps the main thing that I recommend that programmers learn.
Do you think it's useful for a Rubist to know any other language? Is it possible to be a good programmer in Ruby without knowing anything beyond Ruby?
Good question. Honestly, I do not know. All known good Rubies know other languages. However, I do not know whether it is necessary to learn other languages to become a good Ruby programmer. I think that it just happens that people learn other languages.
Good observation! From a medical point of view, the more languages a person knows, the more it delays the onset of his Alzheimer's.
After 40 you have to think about such things
I'm approaching the age of 40! I know this is useful!
Let's talk about the very Ruby. Ruby is a language with a great past. Does he have a future? Not so long ago I was in St. Petersburg at one of the largest IT conferences I've seen in Russia. The local ruby community was not represented at this conference. I constantly had "Ruby-apologetics": Ruby is NOT SO dead, Ruby is still being written. Ruby has, among other things, the best known web frameworks - and all that. Every large language on the market now has some tools for web development. Go, Rust, whatever. What is Ruby's place in this ecosystem and does the "Ruby with a great past" have a future?
I think there are several aspects of the answer to this question. There are many different languages for which there are web frameworks, but I still believe that if you look at them from the perspective of developer ergonomics, Ruby will in any case be in the top. It is easy to use, and it's easy to sell the result. The problem is that Ruby is no longer "brand new and brilliant." People want to get carried away with something new. They want to take the next train after Rails.
They want the smell of a new car!
Yes! About the future In Ruby, there are many new developments, especially this is about JIT and what Koichi works with: guilds. I would say that Ruby definitely has a future, but for this everyone will have to work. If we do our best, the future will be.
Does Ruby have any perspective in other areas besides web development? Or do you know any examples where now Ruby is used outside of web development?
Good question! It's hard to answer, because I'm only dealing with web development issues.
I ask, because this is my personal interest. The guys from the Python community, for example, like to show off their successes in scientific computing.
I know that there is a group working on scientific tools in Ruby. But I think that the real alternative for Ruby is system administration.
How can we attract developers from other languages to our community?
That's really a good question! I think we just need to focus on the development ergonomics, on what makes web application development as easy as possible. You need to focus on lowering the entry threshold for new developers who board and write web applications. So we will attract more new programmers.
It's time for a holovar question, about jаvascript. You know, there is a saying: "Everything that can be rewritten in jаvascript will necessarily be rewritten in jаvascript." Do you think that Rails will also be rewritten in jаvascript? We talked about the ergonomics of the development of Ruby. This is the best thing in Rails. One of the very famous Russian programmers said that "many languages are good, but only Ruby has Rails". However, jаvascript developers tend to question this. How can we compete with jаvascript? Or should we arrange a symbiosis with him?
It's true that only Ruby has Rails. If you look at jаvascript web frameworks, I do not think they are comparable to Rails in terms of design ergonomics. The fact is that since we are writing web applications, we will have to work with jаvascript. We must be part of the jаvascript community. It is useful for us to have a symbiosis. If you can run any language on the server, why it should be jаvascript? But the language is good, and I think we need to work symbiotic. The convenience of development is still on our side, and it is especially appreciated in the Rails community. So, you came to the IT conference, and you had to work there as a representative of Ruby?
It was quite informal, because I did not even have a T-shirt about my company or language. So I just found the brightest group of young people who turned out to be Pythonists, and we started talking.
It's good for us if we work together with other languages, rather than compete with them. Personally, I believe that programming in Ruby is much easier and more enjoyable than in other languages. Why not? We are talking about other programming languages and should we know them. I believe it is important that the Rubies study other languages. Any kind of Java, Haskell or anything else functional like Elixir or Lisp, anything like that. I think it's useful to study different paradigms, because when you learn new things, you can take it away and use it in your own language. A good feature of Ruby is that we can use technology from different languages in our programs.
Yes, we have, for example, tools for functional programming or performing map /reduce or something else.
Yes, we can use all this. If you use a language that encourages these techniques, perhaps you will find a better way to solve the task. I'm not sure that we need to learn other languages right now to be a good ruby, but this study definitely helps me. Honestly, I spend 50% of my time on the playCuring on C.
Si makes the fingers stronger!
I program in C, so that others can program in Ruby.
Ruby internals are written in pure C, not ++?
On the clean. It would be nice if more of this code was written in Ruby, but to be honest, some of the basic things from performance considerations you need to write specifically on C. One of the things I do We need an improvement in memory profiling. So I'm working on tools for profiling memory in Ruby. Since all the insides are written in C, I have to write tools on C. At work, I write a lot of code.
How are things with Ruby with FFI and the like?
FFI works well enough if you have a library in C where you need one or two functions. If something is more difficult That all is more difficult. When you work with FFI, you basically write the code for C, which is similar to Ruby. However, you still have to do such mysterious things as memory management. I personally find that between these worlds it's easier to switch if you use C to manage memory, etc. And in other cases I switch to Ruby.
In Ruby, do we have interfaces to other languages?
Some interfaces with jаvascript. I saw a guy who did scientific tasks, so he interface with Python.
Did he interact directly with the runtime language?
Yes exactly. Not a type of schelling or something like that The project is still very experimental. When he gives a demo, he says that "everything works, but it can fall!"
I know a bunch of famous rubists who went to create Rust. Why do you think people are doing this, and how are they doing?
I like Rust, I think this is a very good language. The reason why people go to Rust they want to have a language that has more protection options than what C gives. It would be really awesome to rewrite Ruby on Rust. I personally am a big fan of Rust, I love it.
How can it be useful? Is it safer, faster, or how?
I think it's safer. I'm not sure if it's more optimized than C, but it's definitely safer. This is what I like about him. When I write C-code, I'm almost sure that it's not SEGV-netsya, but I'm not 100% sure. But when I write on Rust, I'm sure much more. When I write in C, I'm pretty sure there will not be a memory leak. With Rust it is clear as a white day that there will be no memory leaks. That's why I personally prefer Rust, not Si. I also started to study Rust, because I want to write Ruby extensions on it. There is a whole project called "Helix" - specifically for this. Often when I write in C, it's like, "OK, I have a library in C, and I have to get access to it from Ruby by writing a couple of crutches." Use Rust for this is a cannon on sparrows. In my ideal world everything, the whole system will one day be rewritten to Rust. Rust will be our new Si. If you need to quickly solve the problem, you write to Ruby. And the operating system will be done on Rust. And all will be Happiness.
Is Rust enough for this?
Well I do not know. I think, quite. In Mozilla they use it - and are happy.
What is the chance to "see the registers" by running the program on Rust?
Haha, I do not know! I hope it's low! See this is not funny.
Especially when you run something in the browser.
Yes. Pops out the message about the kresh, and you are: "OK." Ha! We have some things on C ++ at work, and sometimes, when I get crashes, I just like this: "Hmm "
I want to program in language, not macro assembler! - it was my favorite joke when I switched from C to Ruby
In fact, you're right. Whenever I write in C, there is a question about what I should think about. I really do not think about the problem to be solved. With Ruby, I do not need to think about all this (low-level farm - PA). I'm just focused on the logic of the program, and I'm doing the job. That's one of the reasons why I love Ruby so much! When I was a javist at the time of Java 1.? it was before the generics appeared there. Every time I had to write something like map-for example, collections or iterators, I had to make "iterator.next ()", and then cast the resulting value Only then do the necessary operation. Then I started to learn Ruby, there the map was already in Perl
Oh, a miracle! I have an object in my hands that is exactly the type I need!
Yes exactly. In Java, I would have to write 15 lines of code to achieve what I can do with a single line in Ruby. I would write to Ruby, I would finish the job much faster! Instead of writing all this stuff! Understanding this was very frustrating for me at that job. I spent hours on unnecessary movements!
Exactly! It was a turning point. I needed to find a job in Ruby. I can not nibble until the end of my life!
Is it possible to say that Ruby improves the mind of a programmer?
I think that if you can spend more time on high-level tasks, the program's goals, this will help improve abstract thinking. You are increasingly exercising in thinking about the system as a whole, and not about the tiny cogs of the program. Let me remind you, in C, I must constantly think about all these little things, and not about the problem that I solve. As a matter of fact, you are trained specifically for Problem Solving, that is, for top-level tasks. I think this can improve you as a programmer.
I remember my own impression when I started in the 90s. I tried to master the OOP. I tried to do C ++. I read books, learned the "holy trinity of the PLO". And then again I find myself in the process of mastering all the same "macro-assembler" tricks. Then I tried to work on Java, I earned some money for Perl. And only in Ruby I finally realized how OOP works.
You talk business. If you think about other OOP languages, such as C ++ or Java, then not all of them have an object. For example, there are still just ints. Still there are primitives, and with them one has to deal differently than with objects. In Ruby, in fact, everything is an object. We have to deal only with the OOP. More exercise, more meaning. I really did not really think about it until you asked.
The language is designed so neatly that it just makes you think in the right direction. It forms the mind. The syntax itself explains what you are doing.
I worked with OOP in Perl. This, in general, seems to be just a hack for OOP-like things. Java, of course, implements OOP. But among her other things there are non-objects. Ruby in our list is the first language on which everything really is an object.
What words would you inspire both young programmers and old ones?
Good question! I think that's what's good for young and old rubies: Personally, I believe that Ruby is the only language that the fan gives when used. Young programmers who have already mastered other languages, try Ruby, because it's really fun. Old programmers who have solid experience in other languages, you can all compare and understand how much Ruby is good. When you use something else, you will say to yourself: wow, and Ruby is nothing!
On weekends, I do small exercises in other languages. After the weekend I return to work, I open my Emacs with Ruby, and I say to myself: "Oh my God, it's wonderful to return home!"
Yes, I think it's good - to switch to other languages, work there, accumulate some observations. I'm always happy to come back. I feel like I'm at home in Ruby.
You can personally ask Aaron your questions on October 6. So I'll see you at the conference! All the details on site .
Read the original in English at hype.codes .
And many thanks to the companies that support the main Ruby event in Russia:
The general partner is Toptal
The Gold Partners - Gett and Cookpad
Silver partners - Instamart , Uchi.ru , JetBrains and Qlean
Partner afterparty - Teachbase
Bronze partners - Bookmate and InSales
It may be interesting
Situs QQ Online
Situs QQ Online