Assess Applicability of the Functional Programming Paradigms in Embedded Hardware - Danny Benlin Oswan; Michiel W. Koehorst; Marcin Gramza (Jurnal Infra, 2015)
Programming in embedded lighting domain is commonly done using the C language with the Object Oriented programming paradigm at Philips Lighting. However applying that paradigm in combination with the low-level language like C creates a conceptual gap between the requirements and design and actual implementation. This results in reduced source code readability and maintainability. Functional programming paradigm was expected to alleviate this problem by reducing the gap and enhancing readability. A proof of concept was built on an advanced, IP-connected, digital LED driver (Power over Ethernet) device. The actual code was inspired by the rule-based decision engine concept developed by EnLight.Based on the hardware specifications of the device, the existing code to communicate with, and adherence to the functional paradigm, Lua was chosen to build the proof with. The implementation of the decision engine was altered to exploit characteristics of functional programming, such as representing actions as functions rather than as an enumeration value, using the common filter function to replace loops, and many more.The proof of concept was able to run in the device. It was also relatively more readable and maintainable. However, it was slightly slower, less memory efficient, and less capable in dealing with low-level problems such as garbage compared to the engine in C language.