N. Sobolev: "I like Elixir in addition to Python"

Elixir-lang.moscow organizer, Auth0 ambassador, CTO at wemake.services
21 September 2017   656

Nikita Sobolev
Nikita Sobolev

CTO at wemake.services, organizer of elixir-lang.moscow conference. 

On the eve of RailsClub 2017, on which Nikita will be one of the speaks, we questioned him about his way to Elixir and it's strong and weak sides. 

Tell me about yourself, what are you doing, who are you?

I'm the technical director of the company "wemake.services" (and yes, we make services) and also I'm conducting a conference on Elixir, "Elixir lang moscow". These are related things: we are a project team and we are developing custom projects. We often work with different technologies and are not afraid to try new things. At some point we had a client who needed to develop something unique, and there were many websockets involved. We work mostly with the Python + JavaScript stack. Neither Python nor JavaScript can't handle that big amount of sockets with adequate number of servers and for adequate money. And we began to look for something to use. If will look from the performance point of view, the best option at that time was Clojure. But I didn't like it the beginning. I didn't like its syntax, brackets all that horror. Clojure is very different from other languages ​​that I know. The second option was the Elixir. At that time I had already met this language and saw the documentation. So I've read about it and decided to try it. I liked it very much. We began to develop very quickly, even that I did not know this language at that time.

What did you like? What is better in comparison with Python?

I liked it in addition to Python. Python has a certain limitations, for example, GIL, bad asynchrony, and so on. From the standpoint of asynchronous programming, Elixir is a dream. Also I really liked such features as pattern matching and pipes. Now I try to use it in all languages where it is possible. This changed the way I see the perfect code. The development went very quickly, taking into account the fact that we did not know this language at all. Elixir looks like a Ruby, although I do not know Ruby ​​at all =) The only problem is OTP and what is connected with Erlang.

Why you didn't choose Go? 

I just don't like Go at all. I don't like it's package manager, I do not like his niche. It seems to be low-level language, but not quite. A very strange piece of art, in my opinion. We didn't even consider it. But I know that now a lot of developers are coding on Go. And many of the Python coders are switching to Go because of performance gains.

What are the main advantages of the Elixir you would single out?

Stability of work. We have an example: there was a tracker for one large logistic company developed on the PHP. It constantly used an unlimited number of resources with regular drops and falls. Everything broke constantly. We were engaged in supporting this service for all day long. Then I've rewritted it to the Elixir and that's it. It already works without problems for  9 months, consumes fewer resources.

Often, when migrating to another programming language, another paradigm, for example, to functional, developer may face problems due to the different approach. When you had migrated to Elixir, it happened?

There are a lot of such problems. They are related to the fact that you can not mutate anything and you can not store the state. Sometimes you need to save some state and then apply to it. I always want to mutate something or perform a monkey patching. In Elixir, this can not be done and this is solved only in 1 way - with processes. Save the state, create new process and put the state there. For a mutation, send a message to the process and it will change it but not by a mutation, but via creating new copy of data. Everything is constantly work on the processes in Elixir. This is a very simple and understandable concept. If you stop treating processes as operating system processes, and understand it like a small, lightweight process that can have its internal states and it can communicate with others processes - it is very similar to objects in OOP. Creating an object is like creating a process in Elixir - it's very similar.

What are the disadvantages of the Elixir?

  1. In the first year of work with the Elixir it did not have any libraries. We wrote everything ourselves. Such as recaptcha, authorization, Russian names decline library and so on.
  2. The number of developers. It is very hard to hire somebody; to find a skilled coder. There are no elixirists at all. There are erlangists but they do not really like Elixir. They love Erlang and love to write on it. But many rubists are interested in Elixir and they migrate to it. It is really cool, but in the same time they will have to learn: 3-5 months (depends on other technologies master level) they will have to learn a lot and code slowly.

There are some technical issues, for example, memory starts to leak if configuration is wrong, or the process will fall due to the wrong architecture. If the process receives too many messages, its "inbox" is full and it dies. There is a good book "Erlang in Anger", it tells about these and other problems.

Erlang is quite old technology, older than Python and Java. Until recently, it remained a niche. Everything changed when Elixir appeared. Why no ErlangVM based programming languages appeared that could make this technology more popular?

This is due to the way how the world of web development is changing now: everything is realtime, big amount of interactions, all services are connected to each other. When you have an isolated synchronous service with no interactions with others - you just don't need it. An opportunity to communicate with other services appeared, to do big amount of things in the same time, asynchronously, and even ability to use in it the microservices appeared. We hadn't rewritten everything on Erlang and Elixir, we've just wrote a small piece of Elixir code and left other code on other languages (as we did with tracker). In these conditions Elixir has become a very suitable technology

How did you end up at a conference for the Ruby developers?

Matter of chance. I just saw the website of the conference and wrote to the organizers. I was asked to make a report. I thought it was a great idea.

What will your report be about?

About the Elixir. Why the Elixir is not a Ruby ​​but better.

Why should an average Ruby coder come to your report?

You can see new horizons. When you listen to the report on a new Ruby gem, you can deepen your knowledge in a particular technology. And if you go to the report on Elixir, you can then expand your knowledge, find out what you can do in general in a different way. Such things help you grow as a developer.

 

N. Sutterer: "Ruby is dead. Long live Ruby!"

Creator of Trailblazer that introduces several new abstraction layers into Rails, Rails contributor and gem author, speaker at Railsclub
15 January 2018   296

Nick Sutterer at RailsClub 2017
Nick Sutterer at RailsClub 2017

Hello! Please, introduce yourself in few words.

My name is Nick Sutterer, I’m developing software for like 22-25 years and I work like a consultant of my open source project for different companies. Sometimes I give presentations at conferences.

Is it your first time in Russia, Moscow, RailsClub?

It is. Everything for a first time. I’m blown away!

How do you like it?

Great! It’s amazing! Since I arrived, people care about me, people take me out, people show me the city, people give me history lessons. It’s amazing. Great food. We go to places and have a drink. I go to hotel, sleep, and everything starts again. That’s amazing! I’m really enjoying it.

Can you tell us about your report in few keynotes?

My talk was about the lack of innovation in Ruby language and about innovations that is happening in frameworks, that use Ruby. I’m just showing what we have. I try to inspire people and Ruby core team to pick some ideas from other technologies and make Ruby even better.

Your talk is called “Ruby is dead”. If Ruby is dead, what’s alive?

Ruby is dead. Long live Ruby. I’m trying to be provocative with my talk. I’m still coding Ruby everyday, I’m still traveling to all conference because I still believe that Ruby is an amazing programming language. There’s languages, showing up recently. Elixir or Golang for example. They have completely different way. They deal with problems and they are way more innovative. But they are brand new. I, actually, don’t think that Ruby is dead.

What you don’t like in Ruby the most?

I hate that we keep thinking in really old way. We reject innovation. It is especially due to frameworks like Rails. I would love to the more development of Rails, with all it’s huge audience. Ruby is lacking a lot of features that a lot of other languages have, like pattern matching and method overloading. The problem is that sometimes I feel that we are behind the innovations that happen to other languages. Specifically features, that make other languages amazing. We don’t have them, and it’s very sad.

What is your way to improve Ruby?

Every time is meet Matz at conference, I tell him for few hours what should be done to improve Ruby. Without any providing any help. It’s all about innovations. I try to innovate in my own framework, Trailblazer. So we can put the way we write business code to new level. I try to inspire people with my library code they use new concepts in Ruby that never been there before. I think that helping them to write the applications.

How do you see the world of programming in 10 and 50 years? And will Ruby and Rails have place in this future?

I don’t think Rails will have place. I really love Rails community and people in Rails Core. But I don’t think that Rails will be a thing in 10 years. But I think Ruby will still be around. It all depends on what is going to happen with Ruby 3.0. When it will be released and what features will it bring. I think Ruby will still be there. But I can’t tell you what will happen in 50 years. Because in 50 years there won’t be a need to program anymore. We will probably just write diagrams on the air.

In your opinion, what technologies are the most hypest today?

Craft beer and coffee, haha! Everything that hipsters do! Now everything is switching from OOP to FP. We are trying to avoid to have unwanted side effects in order to not let users to screw up internal state. Functional programming makes it impossible to users to do stuff in wrong order, for example. Like problems that we have in Ruby. I see a lot of development in functional languages because they are also way easy to paralyze and they have a lot of advanced features.

What advice can you give to average programmer to stand out the crowd?

Important thing in IT is that you always need to play with new tools. Even if you are not a super programmer, you have to look at the community and check what’s going on. It is really important to keep moving. Otherwise, I see that my current job at the police is really slow. They using very outdated technologies. A lot of people are affected. It is non productive. It’s good because a lot of people are keeping their jobs . But it is important to adopt new technologies. I’m not saying be a coding hipster and change your framework everyday. But a lot of new things in last 10 years make sense. People should use it and not just sit there and enjoy excellent job. They can get fired tomorrow.

What makes you excited about your job?

That’s beautiful question. I think that idea of open source is that you expose code that you think is helpful and people will tell you that it really is. This is what keeps me programming. When I write something and I see that a lot of people use it and they say like “It is so much better that I used before!” It’s great! This is making my day. It’s all about what comes back. I also program my own stuff and sometimes I think: “Yes!” But mostly I like when something what I do is helpful to other people.

Do you have any plans on writing a book?

I have already wrote one book. Two years ago, it took like 16 months. I was writing and inventing at the same time. That was a huge mistake! I was keeping updating my book with changes in my library code. It was massive. I plan to write more books, because it was fun. It has to be with the right timing. I’m not gonna write a book about, for example, a new version of my framework now because it’s still changing. I’m not gonna make this mistake again. It’s so much work! Unbelievable.

Do you have any nightmares, related to you job?

I used to have those kind of dreams few years ago. Sometimes I still have them.You always imagine software as something visual. Brain just does that. My dreams about those thing and passing the objects. And it’s always the wrong object! It’s the only nightmare that I have. I was able to have good work\life balance. So I have very rare the bad sleep. Even if I don’t look like it.