Lovely example of using fuel to debug compiler optimisation passes in GHC:
miniblog.
Related Posts
Bril is a cute intermediate language for teaching (think simplified LLVM IR): https://www.cs.cornell.edu/~asampson/blog/bril.html
The idea of providing a standard JSON format to help students write basic passes is really elegant.
tap> is an elegant Clojure debugging feature: it passes the argument to any functions registered with add-tap.
You might set up a custom printer for your data type, or save values for later examination, and you can easily disable the tap too.
Fun post looking at an impressive transformation in clang and tracing it through the different optimisation passes:
