5 ms·
A Gentle Introduction to Multi-Stage Programming [pdf]
- iso-8859-1 10y agoNote that the last release of MetaOCaml was in 2006. This paper is old too, but I don't know exactly how old. But probably about 10 years.
- banach 10y agoA re-implementation of MetaOCaml was released last year (http://okmij.org/ftp/ML/MetaOCaml.html http://okmij.org/ftp/ML/MetaOCaml.html).
- Drup 10y agoThis is quite old. MetaOCaml has been rewritten since (the new version is linked in another comment) 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 https://www.cl.cam.ac.uk/teaching/1415/L28/materials.html Interactive notebook: http://ocamllabs.github.io/iocamljs/staging.html http://ocamllabs.github.io/iocamljs/staging.html
- deleted 10y ago[deleted]
- scribu 10y agoI was confused by the fact that you only linked to the first notebook. There are actually several notebooks related to staging in the course outline. Anyway, thanks!
- akkartik 10y agoAnytime 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 https://scala-lms.github.io
- pzh 10y agoCan 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...
- dkarapetyan 10y agoThis 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.