The Modular Macros project brings new language features for typed, hygienic, compile-time computation to OCaml. Modular macros make it possible for programmers to write high-level libraries that generate efficient low-level code.
Our design builds on a long tradition of work in multi-stage programming, taking inspiration from languages such as MetaML, MetaOCaml and Typed Template Haskell, and integrating smoothly with existing OCaml features, such as its advanced module system. We’ll port existing multi-staged libraries (e.g. for stream processing, parsing and generic programming) and develop new applications that combine high-level abstractions with outstanding performance.
Staged Compilation with Module Functors (pdf)
ICFP 2024
Tsung-Ju Chiang, Jeremy Yallop, Leo White, and Ningning Xie
Safe and efficient generic functions with MacoCaml (extended abstract) (pdf) (code)
OCaml 2023
Dmitrij Szamozvancev, Leo White, Ningning Xie and Jeremy Yallop
MacoCaml: Staging Composable and Compilable Macros (pdf) (video)
ICFP 2023
Ningning Xie, Leo White, Olivier Nicole and Jeremy Yallop
Modular macros (extended abstract) (pdf)
OCaml 2015
Jeremy Yallop and Leo White