Elixir language potential evaluation

We are doing a very similar thing right now.

The system we have to replace is a RPi-CM based mini-server which

  • serves a visualisation for a smarthome (HTTPS server, OAuth2)
  • connects to various field busses (RF and cable)
  • provides a Hub for those (similar to, but not as feature rich as: https://www.home-assistant.io/)
  • handles some hard-keys and LEDs
  • is OTA-updateable

The current system uses:

  • python (Hub, some scripts)
  • node (server)
  • C and Cpp (bus stacks)
  • .deb (updates)
  • bash (some scripts)
  • systemd
  • crazy test system
  • …more

We decided to go for Elixir/Nerves for the next generation.
@mindok has very nicely summarized the reasons for that decision, but I want to point out:

  • functional language (Elixir or Erlang is the only functional language I’d consider for an embedded system. Functional languages have great advantages I won’t go into here, but the biggest plus I expect is better testability)
  • we can do everything (but some fast-hard-realtime stuff) in one language. This is a big plus, especially for a small team.
  • possibility to run on small platforms like iMX6UL - even without Linux, see GRiSP2
  • erlang’s binary pattern matching is a game changer when implementing protocols (I did put Elixir to the test by implementing the part of the system I saw it least fit for: the KNX protocol stack. This turned out very nicely)
  • Nerves is a great tool for building embedded software systems and makes OTA updates simple. (Our current desktop-OS and .deb system is a pain in the ass with thousands of servers in the field)
  • OTP (Supervision tree kills systemd, we can create on (umbrella/poncho?) project for the whole system.)
  • Elixir is a great language, with a very good ecosystem including a great community. There are lots of people here, that are here because they’ve already seen some other stuff.
5 Likes