mazeppa  by mazeppa-dev

Supercompiler for call-by-value functional languages

created 1 year ago
422 stars

Top 70.8% on sourcepulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

Mazeppa is a supercompiler designed for call-by-value functional languages, aiming to optimize programs by symbolically evaluating them and synthesizing more efficient residual code. It targets developers and researchers seeking advanced program transformation techniques beyond deforestation and partial evaluation, offering capabilities akin to theorem proving.

How It Works

Mazeppa employs a supercompilation process that involves unfolding function definitions, analyzing calls with unknown variables, breaking down computations, folding repeated computations, and decomposing irreducible calls. This iterative process generates a process graph that is then transformed into a residual program. The system utilizes lazy constructors for functions and eager evaluation for constructors, which facilitates deforestation while preserving semantics.

Quick Start & Requirements

  • Installation: Install via OPAM: opam install mazeppa. Alternatively, clone the repository and run ./scripts/install.sh.
  • Prerequisites: OCaml and OPAM. Graphviz is required for visualization (sudo apt install graphviz).
  • Flambda: For improved performance, build with an Flambda-enabled OCaml compiler.
  • Documentation: Official Docs (for Flambda setup).

Highlighted Details

  • Translates to native machine code via GNU C11.
  • Supports manual control over function unfolding.
  • Provides full transparency into transformation decisions.
  • Demonstrates synthesis of complex algorithms like KMP from naive implementations.

Maintenance & Community

  • The project is actively developed by mazeppa-dev.
  • Community links are not explicitly provided in the README.

Licensing & Compatibility

  • The README does not explicitly state a license.

Limitations & Caveats

  • The README warns against using --inspect in production and advises against CPU-intensive computations due to termination checking.
  • Supercompilation's unpredictability is noted as a challenge, with @extract annotations provided as a mechanism to control behavior.
  • The project is not yet considered production-ready, with a long-term goal of profitable supercompilation for files under 10,000 LoC.
Health Check
Last commit

3 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
14 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.