Mon Jun 10 07:35:40 EDT 2019
Metaprogramming for embedded engineers
So what's this haskell thing about?
To cut right down to the chase: In embedded systems, you often want to
write some piece of resource constrained code without having to pay
abstraction overhead. Doing this manually often leads to very hard to
understand code. The obvious solution to that is to start moving
abstraction to compile time by generating code from some
representation that is easier to understand and modify.
- So basically, you're writing a language and a compiler. Best to
realize this early and use good tools.
- Examples: languages based on macros, or languages based on algebraic
datatypes. In general, functional programming languages are good
for this. The fact that ML stands for MetaLanguage should be a
- In the last two decades, final tagless form has emerged as a way to
represent typed metaprogramming. What this boils down to is that
Haskell or OCaml is used as the macro language. This is an
incredibly powerful idea when you contrast it with explicit