Development of embedded systems has been receiving in last decade a considerable attention for both academy and industry. Advances in hardware miniaturization, in particular, single-boards computers like Raspberry Pi, Beaglebone Black, allow for the use of high-level programming languages. Still, the greatest challenges when developing IoT applications are distribution and coordination. To date, mainstream languages (e.g. Java, JavaScript, Python) lack high- level abstractions to deal with distribution and coordination. For example, implementing standard leader election algorithms (e.g., Ring, Bully) with these languages, force developers to write code on top of low-level networking APIs. As a result, programmers need to write over and over, aspects like the discovery of peers, coordination, failure handling necessary for implementing distributed algorithms. Furthermore, craft and deploy such systems on embedded devices is also complex, due to hardware restrictions and software dependencies. In this demo, we show how a concurrent and distributed language with a rich macro system could in an easy and declarative way solve these problems. Our demo recreates a leader election algorithm between the nodes in an embedded environment by employing a Raspberry Pi cluster. The code for the leader election algorithm is built on top of a macro-based Elixir library which includes abstractions for distribution and coordination. Developers can use this library to translate core operations described by the Bully algorithm to declarative macro-constructs. This library also abstracts developers of communication and network concerns (e.g. service discovery and network monitoring). Furthermore, it includes an implementation of an Elixir behaviour (design pattern) to provide a base skeleton for developing leader-election applications.
Original languageEnglish
Title of host publicationAn Elixir Library for Programming Concurrent and Distributed Embedded Systems
Place of PublicationNew York, NY, USA
Number of pages1
ISBN (Electronic)978-1-4503-4836-2
StatePublished - 6 Apr 2017
Event - Etterbeek, Belgium

Publication series

NameProgramming '17


Internet address

    Research areas

  • Concurrent Programming, Distributed Programming, Embedded systems, Leader Election

ID: 31323737