Metaprogramming is a curse. At the end of the day an advanced Lisp/Forth programmer (at heart) can't resist the urge to write programs to generate programs that solve their problems rather than just solve the problem directly.
Conversation
As an embedded systems (firmware) developer with a comp sci background, I can't seem to resist it. Metaprogramming is like catnip
1
1
Replying to
It makes perfect sense in embedded systems, especially those that are static. I started forgiving myself for this once I realized that most HDL work is also about "instantiation of patterns". Why not do that for FW as well? Remove all late binding, more room for optimization.
1
Maybe a better way to put is that there isn't a lot of room for abstraction on the device, so move it to compile time. Compile model to code, which also makes it possible to test the model independently.
1
I'm a one trick pony, but I really like this approach: okmij.org/ftp/tagless-fi
I used it for generating Verilog, and testing/generating cycle-accurate PRU-ICSS machine code.
Moving away from Scheme on to Haskell has made it manageable.

