Higher-Order Concurrency for Microcontrollers

08/17/2021
by   Abhiroop Sarkar, et al.
0

Programming microcontrollers involves low-level interfacing with hardware and peripherals that are concurrent and reactive. Such programs are typically written in a mixture of C and assembly using concurrent language extensions (like and ), resulting in unsafe, callback-driven, error-prone and difficult-to-maintain code. We address this challenge by introducing - a bytecode-interpreted virtual machine that provides a message-passing based higher-order concurrency model, originally introduced by Reppy, for microcontroller programming. This model treats synchronous operations as first-class values (called ) akin to the treatment of first-class functions in functional languages. This primarily allows the programmer to compose and tailor their own concurrency abstractions and, additionally, abstracts away unsafe memory operations, common in shared-memory concurrency models, thereby making microcontroller programs safer, composable and easier-to-maintain. Our VM is made portable via a low-level bridge interface, built atop the embedded OS - Zephyr. The bridge is implemented by all drivers and designed such that programming in response to a software message or a hardware interrupt remains uniform and indistinguishable. In this paper we demonstrate the features of our VM through an example, written in a Caml-like functional language, running on the and microcontrollers.

READ FULL TEXT

page 5

page 9

page 10

research
05/06/2022

Synchron – An API and Runtime for Embedded Systems

Programming embedded systems applications involve writing concurrent, ev...
research
11/05/2021

Pirouette: Higher-Order Typed Functional Choreographies

We present Pirouette, a language for typed higher-order functional chore...
research
05/27/2021

Hailstorm : A Statically-Typed, Purely Functional Language for IoT Applications

With the growing ubiquity of Internet of Things(IoT), more complex logic...
research
02/19/2019

Composing bidirectional programs monadically (with appendices)

Software frequently converts data from one representation to another and...
research
03/22/2023

Practical compilation of fexprs using partial evaluation: Fexprs can performantly replace macros in purely-functional Lisp

Macros are a common part of Lisp languages, and one of their most lauded...
research
03/08/2023

Alice or Bob?: Process Polymorphism in Choreographies

We present PolyChorλ, a language for higher-order functional choreograph...
research
12/31/2019

Introduction to Rank-polymorphic Programming in Remora (Draft)

Remora is a higher-order, rank-polymorphic array-processing programming ...

Please sign up or login with your details

Forgot password? Click here to reset