Elixir in 2021: The Now, The Tomorrow, The Future

If I was asked, what word best describes Elixir as a language in 2021, it would be maturity.

Table of contents

    Elixir is unique among actively maintained programming languages. Why? Because feature-wise, it is - according to Jose Valim's release notes for Elixir 1.9 in 2019 - more or less finished, complete.

    As mentioned earlier, releases was the last planned feature for Elixir. We don’t have any major user-facing feature in the works nor planned. I know for certain some will consider this fact the most excing part of this announcement!

    This is followed by a reassurance for those who might have thought it's ALL over:

    Of course, it does not mean that v1.9 is the last Elixir version. We will continue shipping new releases every 6 months with enhancements, bug fixes and improvements.

    Jose and the entire community behind Elixir stayed true to their words. 2020 has seen two new Elixir versions - 1.10 and 1.11, both of which added important features developers have been calling for:

    • Improvements to sort-based APIs in Enum - :asc and :desc semantic shortcuts for easier sorting
    • Tracking of compile-time configuration - for a clearer distinction between compile-time and runtime configuration
    • Compiler tracing - new capabilities for developers to listen to compilation events.
    • Tighter Erlang integration for logging and documentation browsing
    • Additional compiler checks: application boundaries, struct field usage in function body
    • Compilation time improvements by better dependency tracking

    And, in addition to these, many smaller improvements have been added as well. For a smaller languague such as Elixir, a vibrant community and its active stewardship, are vital contributors to success.

    Will there ever be an Elixir 2.0?

    Jose Valim has explained that "there are two main reasons why we can afford to have an empty backlog":

    First of all, Elixir is built on top of Erlang/OTP and we simply leverage all of the work done by Ericsson and the OTP team on the runtime and Virtual Machine. The Elixir team has always aimed to contribute back as much as possible and those contributions have increased in the last years.

    Second, Elixir was designed to be an extensible language. The same tools and abstractions we used to create and enhance the language are also available to libraries and frameworks. This means the community can continue to improve the ecosystem without a need to change the language itself, which would effectively become a bottleneck for progress.

    So, the most reasonable answer to the question above is: no, at least not in a foreseeable future. That should not be taken as Elixir's disadvantage, though. Let's quote Jose again:

    What makes Elixir powerful is the ability to be extended. Our goal is to enable.

    What is useful or what is a common use case changes with time. What is useful today may not even be an agreement in the community itself: think about what is useful for Phoenix and what is useful for Nerves.

    Furthermore, code that is added to Elixir cannot be easily removed and will have to be maintained for a very very very long time.

    I don't want to look at Elixir in 10 years and look at all of the cruft we have added through the years that is no longer used because of what was considered useful back then. (https://groups.google.com/g/elixir-lang-core/c/jjzm4jnRLo0/m/UEWPtXLrCAAJ?pli=1)

    In a nutshell: everything that doesn't need to be in the language's core belongs to a package. There is a knock-on effect of keeping this paradigm at the very core of the language's philosophy It is that library creators more clearly understand the need to reduce bloat and keep various programming concerns well-separated between packages. This is well exemplified by most broadly adopted libraries such as Ecto and Phoenix.

    So, by jumping on the Elixir bandwagon, you’re essentially guaranteed to enjoy a stable language that’s not going to have breaking changes implemented anytime soon. Nor are you going to find yourself adjusting to some fancy new syntax that your linter will suddenly start asking for.

    This is something Elixir users won't relate to in 2021.

    This is something Elixir users won't relate to in 2021.

    Elixir is extensible and has brilliant metaprogramming capabilities which make it possible to introduce any syntactic sugar one desires. This obviously shouldn’t be overused, but – for instance – if you feel that the following Elixir syntax is too repetitive:

    %{foo: foo, bar: bar, baz: baz} = map

    ...then you can grab a very simple macro-based library to introduce a syntax closer to JS-style destructuring:

    ~M{foo, bar, baz} = map

    And again, it’s very unlikely that a change like this will ever get into the Elixir language core, because this is not something universally called for in the community. And even if it was, it’s not likely that it will be considered a critical feature to be added. But – per the language’s philosophy – if you want the language to have this capability in your project because you feel it’s worth it and gives you econvenience, then... have a go!

    Elixir future is Erlang/OTP future

    James Fish, member of the Elixir and Ecto core teams, said in his 2019's Code BEAM SF talk:

    Elixir language now is probably like as complex as it's gonna get, there is very little low hanging fruit to work on, it should hopefully be very stable. If you want to make improvements to Elixir, there's great places like faster compilation, better error messages, these kind of things maybe rely on you contributing to OTP instead of Elixir. If you want to change how the BEAM works to benefit Elixir (...), again you have to contribute to Erlang rather than Elixir.

    Thanks to the symbiotic relationship with Erlang, Elixir is so performant. This also means that it's dependent on Erlang in terms of the directions of its development. Thankfully, it's a very solid fundament - Erlang is key in several large-scale telecommunication systems, where it's still a mighty tool.

    Feet on the ground and a sip of Elixir

    It took a few years for Elixir to settle in the development world. In 2021, though, it occupies an interesting niche, and in specific applications it shows its teeth and is unmatched by its competitors.

    Along with Phoenix, it gives a foundation to many big-scale web apps. If you’re after a scalable MVP, Elixir can be a perfect choice. Nerves makes it a great choice for embedded software, too.

    That’s the positive side, but you also need to keep your feet on the ground – Elixir will likely never be as popular and have as sizeable a community and abundance of ready-to-use libraries as some of its competitors. It’s not a language that has a solution for every possible problem on Stack Overflow.

    If a project’s expected complexity level is very low (more often than not, it’s a bit unwise to make such an assumption, though), you might find the usage of Elixir similar to driving a Tesla in your backyard. Perhaps you could benefit from using Elixir’s power and performance just for a specific module of your product – after all, it’s about using the right tools for a job, which is a philosophy we strongly believe in .

    Elixir is not the Answer to the Ultimate Question of Life, the Universe, and Everything. However, it’s still a very powerful and interesting language worth exploring. Have fun!

    Download our ebook
    Michał Buszkiewicz, Elixir Developer
    Michał Buszkiewicz Curiosum Founder & CTO

    Read more
    on #curiosum blog

    Phoenix LiveView Tutorial: Adding Phoenix PubSub and Pow Authentication to Messenger

    We've already bootstrapped our Phoenix LiveView-based Messenger app's database structure and a first LiveView page.

    This time, we're going to improve real-time communication between the app's users using Phoenix PubSub, and use the Pow library to add secure user authentication.

    As of November 2020, the latest Phoenix LiveView version is 0.14.8 - and the series has been updated to match it!

    5 top-tier companies that use Elixir

    Elixir is a pretty capable language - and it consistently ranks near the top of most loved and wanted languages rankings. It has a large following and some very persuasive preachers as well. But that would not be enough to make me like it – what I need as real proof of its strengths is real businesses that strive with Elixir.

    That’s what this list is all about – a bunch of stories from top companies that chose Elixir and never looked back. Let us show you how its power and versatility shows in practice.