ABSTRACT
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.
- Saša Jurić. 2015. Elixir in Action. Manning Publications Co.Google Scholar
- Chris McCord. 2015. Metaprogramming Elixir. The Pragmatic Programmers, LLC.Google Scholar
- Dave Thomas. 2016. Programming Elixir 1.3. The Pragmatic Programmers, LLC.Google Scholar
Index Terms
- An Elixir library for programming concurrent and distributed embedded systems
Comments