RailsClub 2017. Interview with the organizer of elixir-lang.moscow Nikita Sobolev

    We are already packing 600 distribution packages for RailsClub 2017 participants on September 23, and our speakers are adding the finishing touches to their presentations. Today, Alexey Mogilnikov talked about Elixir with Nikita Sobolev, who does services at wemake.services, organizes meetings elixir-lang.moscow and is the ambassador of Auth0.

    image


    Tell me about yourself, what are you doing?

    I am the technical director of wemake.services (and yes, we do services), and I also conduct conferences on Elixir ( elixir-lang.moscow) These two aspects are connected: we are a project team, we are engaged in the development of custom-made 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 a lot of web sockets were involved there. We work mainly with the Python + JavaScript stack, and neither Python nor JS can support such a number of sockets on an adequate number of servers and for adequate money. We began to look for what can be applied. The best performance option at the time was Clojure. But I didn’t work with her - I didn’t like the syntax, brackets, all this horror. Clojure is too different from other languages ​​that I know. I didn’t get it. In second place on my list was Elixir. At that time, I already met this language, saw the documentation. I read, I decided to try it and I really liked it! We started developing very quickly, especially considering that I did not know this language at all.

    What did you like? What bribed in comparison with Python?

    I liked Elixir precisely as an addition to Python. Python has certain limitations: for example, GIL, poor asynchrony, etc. In terms of asynchronous programming, Elixir is a fairy tale. I really liked chips like pattern matching and pipes. Now I try to use them in general in all languages ​​in which I can. This has changed the way I see the perfect code as a whole. When we started to apply all this, development went very quickly, especially considering that we did not know this language at all. Elixir is like Ruby, but I don't know Ruby at all :). The only difficulty is OTP and what is related to Erlang.

    Why didn’t you choose Go? Why didn't he fit?

    I just don't like Go and that’s it. I don’t like his package manager, I don’t like his niche: it’s kind of low-level, but not quite. A very strange craft, in my opinion. We did not even consider it, but I know that now a lot of developers write on Go. And many are switching to Go with Python, due to performance gains.

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

    Stability of work. We have an example: for one large logistics company, a tracker was written in PHP. He constantly ate an unlimited amount of resources, fell and died (then the Russian Post gives clumsy statuses, then you have to give clumsy statuses) everything constantly broke. We have been supporting this service all day. And then I copied it to Elixir and that’s it! It has been working without problems for 9 months now and consumes many times less resources.

    Often, when switching to another programming language, to another paradigm, for example, a functional one, problems begin due to the difference in approaches. Does the Elixir transition happen?

    There are a lot of such problems. They are connected with the fact that nothing can be mutated and states cannot be stored. Sometimes you want to keep some state, so you can turn to it later. I constantly want to mutate something, do monkey patching. This cannot be done in Elixir, it is solved only in one way - by processes. Save the state, create a new process and put the state there. If you want to mutate something somewhere - send a message to the process, it will change it, and not by mutation, but simply by creating a new copy of the data. In Elixir, everything is built on processes, it is a very simple and understandable concept. If you stop referring to processes as to full-fledged processes of the operating system, and understand that it is just a small lightweight process that can have its own internal states, which can communicate with others, then this is very similar to objects in OOP. What you create an object, what you create a process in Elixir is very similar.

    What are the disadvantages of Elixir?

    In the first year of our work with Elixir, he had no libraries. We wrote everything ourselves: authorization through vkontakt, a library for the declension of Russian names, the addition of recaptcha. The second problem is the number of developers, the ability to hire someone, the level of expertise. There are no elixists at all, there are erlangists, but they do not really like Elixir - they love Erlang and want to write on it. Now, many Rubistists are interested in Elixir, they want to switch to it. This is cool, but of course they will have to learn: 3-5 months (depending on the level of knowledge of other technologies) will have to be mastered, during this period they will have to be a little dumb and write slowly. There are still certain technical problems. For example, memory starts to leak due to improper settings, or processes are lying around when they are too loaded due to incorrect architecture. If the process receives too many messages, the message box will overflow and everything will die. It is rather a matter of architecture, proper construction. There is a good book “Erlang In Anger”, it tells just about these and other problems that may

    Erlang is a pretty old technology, older than Python and Java. Until recently, it remained a niche. Everything changed when Elixir appeared. Why didn’t new languages ​​appear on the basis of the Erlang virtual machine that would help this technology become mainstream?

    This is due to how the world of web development is changing: all realtime, a large number of interactions, all services are connected to each other, somehow communicate. When you have an isolated service that does not interact with others, synchronous - all this is simply not necessary. There was an opportunity to communicate with other services, to do a bunch of everything in real time, asynchronously, and moreover, it is possible to put all this into microservices. Do not rewrite everything to Erlang and Elixir, but write a small piece (as we did with that tracking), and leave the rest of the code in other languages. Under these conditions, Elixir has become a very suitable technology.

    How did you end up at the rubist conference?

    Matter of chance. I saw the conference website, wrote to the organizers. I was asked to give a presentation and I thought it was a great idea.

    What will your report be about?

    About Elixir. Why Elixir is not Ruby, but Better.

    Why should an average rubist come to this report?

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

    Come to the report, the conference is already on Saturday! Register here .

    Traditional thanks to the companies that support RailsClub.
    image
    mkdev is the place to find and hire a personal programming mentor.
    Regardless of whether you work or are just starting to learn, a mentor will help you set professional goals, draw up a personal training program, intensively pump in the right field of development, check all your code and answer all your questions as soon as possible.
    Mkdev has mentors with a wide range of specializations - from web development on Django, Rails, ASP.Net, and Spring, to mobile development, system programming, DevOps and working with big data.

    See you on Saturday!

    Also popular now: