Anytime I read about multi-stage I'm reminded of this absolutely fascinating project to turn stage 0 code into stage 1 code: https://scala-lms.github.io
Can somebody shed some light on how this is different from delayed/lazy evaluation? I thought languages like Scala and Haskell already support these patterns, but I haven't heard the term 'multi-stage' applied to them...
This is more like hygienic lisp macros, .net expression trees, jvm bytecode generation, etc. You are generating and compiling code instead of just deferring the evaluation to the last minute.
A better ressource to learn about multi stage metaprog in OCaml is Jeremy Yallop's course on advanced functional programming:
See "staging" sections: https://www.cl.cam.ac.uk/teaching/1415/L28/materials.html
Interactive notebook: http://ocamllabs.github.io/iocamljs/staging.html