Skip to content

agda/agda2lambox

Repository files navigation

agda2lambox

An Agda backend to generate MetaCoq λ□ (LambdaBox) programs for further (verified) extraction to WASM or Rust. The backend builds off Agda 2.7.0.1. Compatible with Coq 8.19.0, MetaCoq 1.3.1 and CertiCoq 0.9.

To install the backend, setup GHC (tested with 9.10.1) and cabal.

git clone git@github.com:omelkonian/agda2lambox.git
cd agda2lambox
cabal install

This will take a while, as it has to (recursively) clone the Agda repo and compile from source.

Then you're good to go.

agda2lambox [AGDAFLAGS] [--out-dir DIR] [--typed] FILE

Setup

The backend generates .v and .txt files that contain the extracted λ□ environment. To check what's generated, setup CertiCoq and compile the minimal Coq prelude.

opam pin add certicoq 0.9+8.19
coq_makefile -f _CoqProject -o CoqMakefile
make -f CoqMakefile

TODO

  • Type aliases (See #3)
  • Improve type compilation
    • The (re)implementation of the type translation is currently incomplete. In particular, when compiling an application, we should retrieve the type of the head and compile the elims with it.
  • Check support for Agda-specific edge cases
    • Projection-like (See #6)
  • Support primitives (ints and floats)
  • Setup compilation to Wasm/Rust using Certicoq
  • Setup proper testing infrastructure

Icebox

Things that ought to be implemented, but not right now.

  • Caching of compiled modules.

References

About

Compiling Agda's internal syntax to λ-box terms.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published