A modern supercompiler for call-by-value functional languages that transforms programs via symbolic evaluation and metasystem transitions.
Mazeppa is a modern supercompiler designed as a compilation target for call-by-value functional languages. It performs deep program transformations by symbolically evaluating programs with unknown runtime values, discovering execution patterns, and synthesizing them into more efficient residual code. This approach subsumes deforestation and partial evaluation, enabling powerful optimizations like algorithm synthesis and interpreter elimination.
Compiler engineers and language implementers building functional language compilers that require advanced optimization techniques like deforestation, partial evaluation, and algorithm synthesis. Researchers interested in supercompilation and program transformation techniques.
Developers choose Mazeppa for its combination of deep optimization capabilities with practical features like native code generation via GNU C11, manual unfolding control, and transparent transformation decisions. Unlike simpler optimizers, it can perform metasystem transitions to collapse multiple interpretation levels and synthesize algorithms like KMP string matching from naive implementations.
A modern supercompiler for call-by-value functional languages
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Mazeppa subsumes deforestation and partial evaluation, enabling algorithm synthesis like transforming a naive string matcher into KMP, as shown in the examples.
It translates to native machine code via GNU C11, providing a practical path from functional programs to executable code, demonstrated in the C translation section with Boehm GC integration.
The --inspect flag generates visualizable process graphs and JSON files, allowing detailed inspection of supercompilation decisions for debugging and analysis.
@extract annotations let developers control unfolding and prevent exponential code blowup, offering a balance between automation and predictability, as explained in the SAT solver example.
Eager functions with lazy constructors enable effortless deforestation while preserving semantics, as seen in the sum-squares example where intermediate lists are eliminated.
Supercompilation can lead to exponential blowups or unintended optimizations, requiring manual @extract annotations, which the README admits is only a partial solution and adds complexity.
Installation requires OCaml with Flambda for optimal performance, and C translation depends on external libraries like Boehm GC, making setup non-trivial and error-prone.
The project is not production-ready per its FAQ, lacks a type system and built-in I/O, and has a small community, limiting practical use without significant front-end development.
Termination checking can make CPU-intensive computations extremely slow, and supercompiling whole programs is discouraged in favor of modular approaches, as noted in usage considerations.