r/functionalprogramming • • Jan 25 '21

Question Embedded programming for the functionally-inclined programmer?

Hi y'all!

In the recent year or so I've been working a little bit with Arduino (a roundtrip for me, as my career started with microcontrollers), and I got a reminder that C++ is a terribly complex and difficult programming language, and I would like to have nothing to do with it if possible.

I am familiar with some FP influence on system programming (Rust, e.g.). I've heard about academic results in optimising high-level languages to predictable low-level programs, and there are fun languages such Futhark and LambdaCube that target the GPU. But to the best of my knowledge none of the above target the processors used for Arduino and other popular embedded platforms.

So my question is: where are we with popular embedded platforms such as Arduino? Am I doomed to continue to reason on who owns the pointer to what part of the memory forever?

12 Upvotes

18 comments sorted by

View all comments

Show parent comment

5

u/[deleted] Jan 25 '21

Even though C++ is an absolute beast of a language, it really does allow you to express and optimize stuff that no other language will let you do.

As someone that has been working with C I take offense to this!

It also lets you leak memory in ways that no other language will let you do.

...And this!

Just kidding. But the Rust community is great and it's exciting to see it taking on embedded hardware so well. I was working with the esp8266 when I stumbled across this blogger that had the same ideas as me. From what I've seen you can build some surprisingly small binaries with no_std.

3

u/ragnese Jan 25 '21

As someone that has been working with C I take offense to this!

Come back when C gets generics and move semantics. ;)

...And this!

Come back when C gets... this: https://jsteemann.github.io/blog/2015/11/18/on-exception-handling/

xD