Many of us in Simply Business have taken an interest in Elixir lately: it's fun to use, it's got a very solid foundation in Erlang and it could fit some of our use cases quite well.
For a deep dive into the Elixir community and ecosystem, last April we packed our laptops and flew over to Warsaw, Poland, to attend ElixirConf EU 2018.
This is the first in a series of posts where we'll share our notes from some of the most interesting talks at the conference.
Elixir is a 7 year-old programming language building on top of the 32 year-old Erlang runtime. Its syntax is very much influenced by Ruby whilst the language itself is functional. Elixir code is compiled into bytecode that runs on BEAM virtual machines. The generated bytecode is no different to that of Erlang, making the Elixir - Erlang relationship similar to that of Scala - Java, or C# - [F#.
Some key advantages of Elixir over Ruby are as follows:
Property based testing is another way of testing that's gaining traction in Elixir. The idea is that your test would generate random inputs (according to certain rules specified by the developer), run the code and verify the validity of outputs (again, based on rules). The main advantage of property based testing compared to traditional example based testing is that it's able to find edge cases that a developer hasn't thought about.
The great thing about having built-in support for property based testing is that it makes investigating failures super easy. When your test fails, Elixir will try and shrink the randomly generated input down to the smallest possible input that fails, then provide it as part of your failure message. You can then write a standard example test and iron out the bug - or change the rules in your property test if the input should be considered valid.
Elixir 1.7 will come with
Stream.Data that will allow to easily build custom generators from provided building blocks.
Short introduction and origins in Jose Valim's talk.
Implementation details in Andrea Leopardi's talk.
There was some discussion about distributed computing when using unstable networks or devices. We really liked the possibilities that open up with using CRDTs - Conflict-free Replicated Data Types. A CRDT is essentially a set of functions that define how to compare and merge values. This becomes useful when you have data replicated across multiple nodes but for some reason your nodes go out of sync. CRDTs allow you to define how to sync the data back in a lossless way.
Lots of theoretical detail in this presentation by Arkadiusz Gil.
Fernando Mendes presented a practical (and fun) use case for CRDTs.
Want to know more about what it's like to work in tech at Simply Business? Read about our approach to tech, then check out our current vacancies.Find out more
Keep up to date with Simply Business. Subscribe to our monthly newsletter and follow us on social media.Subscribe to our newsletter
99 Gresham Street
29 St Katherine's Street
© Copyright 2019 Simply Business. All Rights Reserved. Simply Business is a trading name of Xbridge Limited which is authorised and regulated by the Financial Conduct Authority (Financial Services Registration No: 313348). Xbridge Limited (No: 3967717) has its registered office at 6th Floor, 99 Gresham Street, London, EC2V 7NG.