Simply Business homepage
  • Business insurance

    • Business Insurance FAQs

    Business insurance covers

  • Support
  • Claims
  • Sign In
Call Us0333 0146 683
Chat With UsChat support 24/7
Tech blog

Notes from ElixirConf EU 2018 (part 1)

2-minute read

Quynh Nguyen, Hanna Kalinowska, Ivan Bakalov

Quynh Nguyen, Hanna Kalinowska, Ivan Bakalov

3 July 2018

Share on FacebookShare on TwitterShare on LinkedIn

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 in a nutshell

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:

  • It enforces immutability, making Elixir code more predictable and easier to work with
  • It incorporates some modern and powerful syntax, including pattern matching, pipe operator and async/await
  • It inherited the powerful and battle tested Erlang runtime

Simply Business events

Property based testing

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.

CRDTs

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.

Ready to start your career at Simply Business?

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

We create this content for general information purposes and it should not be taken as advice. Always take professional advice. Read our full disclaimer

Find this article useful? Spread the word.

Share on Facebook
Share on Twitter
Share on LinkedIn

Keep up to date with Simply Business. Subscribe to our monthly newsletter and follow us on social media.

Subscribe to our newsletter

Insurance

Public liability insuranceBusiness insuranceProfessional indemnity insuranceEmployers’ liability insuranceLandlord insuranceTradesman insuranceSelf-employed insuranceRestaurant insuranceVan insuranceInsurers

Address

6th Floor99 Gresham StreetLondonEC2V 7NG

Northampton 900900 Pavilion DriveNorthamptonNN4 7RG

© Copyright 2024 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.