Elixir - Keeping up with the JS’s
Lab Zero has been building server-side applications for products of all shapes and sizes using languages like Ruby, JavaScript, PHP and Java since 2008. We’re always looking for the best tools available and that has generally been satisfied in the Ruby and JavaScript ecosystems. We still love Ruby and JavaScript, and will continue writing both, but I’ve been feeling the itch to adopt an additional language and framework to the LZ toolbelt.
Ultimately, even though Ruby performs adequately for most web applications at scale, we encounter doubts about whether it’s fast enough. JS is definitely speedy, but the ecosystem feels a bit like the Wild West.
What language should we adopt next?
The decision of which new framework to adopt was guided by a handful of emotional and empirical concerns. Whatever we picked needed make us feel good on these points:
- Eff-you performance, at least as fast as Node or Java
- Elegant and productive syntax, producing readable self-documenting code
- Active community, you can find good developers and libraries
- Not Java or JavaScript (I’m so sorry to admit this, but it’s true)
The more I pushed for Node, the more the team talked about other languages like Python or Elixir. Then it happened: one of our Principal engineers did some homework on Elixir and shared it with the team. A few folks fell in love with it, and have been diving deeper.
Taking shots of Elixir in a dark place
We decided that as part of our “Learn once, do once, teach once” approach to adopting new practices we would need to kick the tires on Elixir. This is the sort of thing that works best on friendly internal projects.
Sasha fiddled with it, wrote a Phoenix app and gave the team a couple of brownbag talks. Brien Dockerized it quickly and posted about it here. Rob rewrote one of his personal projects in Elixir with Phoenix.
We didn’t go blind
We saw our brains change about the way we think about code. And deployments. Yes, the functional language thing about immutability is bit of a bump at first.
If you pick up Elixir, you will likely observe things like this:
- Like a community pool, Elixir is accessible to all. You can dip your toes or dive for shinies at the bottom of the deep end. You can get started quickly just like you did when you first tried Rails.
- Milliseconds now seem slow when you see your REST API respond in µ-seconds.
- Lots of tools are written for you already. If you are coming from Rails and worried that the RubyGems equivalent list of tools isn’t there, well, it isn’t, but you should be good to go for most common things you’ll need.
- The community is on fire and growing. The developers behind the language and tools are actively engaged and available.
- Your brain will bend when thinking about immutability and how those idioms are very different than what you’re used to with OOP.
- Elixir is an evolution, not a revolution. The language, tooling and libraries draw on much experience with modern languages, their deficiencies and their advantages.
- Elixir includes all the power of Erlang and the Open Telecom Platform (OTP); it is an amazing and rich platform.
See for yourself
Here are a handful of resources to learn more about Elixir from folks using it:
- The Erlangist - Why Elixir
- Elixir in times of microservices
- Functional programming kool-aid
- Elixir Performance vs Node and Spring
- Who is using it in production?
- The 2M websocket concurrency problem
- Elixir Success stories
- Pinterest is Elixing
- Erlang to Elixir in big startups
- Bleacher Report: 18 Months of Elixir in Production
Continue the conversation.
Lab Zero is a San Francisco-based product team helping startups and Fortune 100 companies build flexible, modern, and secure solutions.