leanfran compiles Lean 4 IR to Clojure (LeanClj/, Main.lean) and embeds Lean
in Clojure (src/leanfran/core.clj). See the backend README for usage.
Paths in this guide are relative to langs/Clojure/.
LeanClj/EmitClj.lean: the emitter. Collects IR decls from roots, emits
Clojure forms, and derives the marshalling descriptors of public functions.LeanClj/Sx.lean: S-expression tree and layout.Main.lean: the leanfran CLI.src/leanfran/runtime.clj: runtime. lean_* functions are named after the C
symbols of Lean externs; generated code checks at load time that every
symbol it uses exists (check-symbols!).src/leanfran/core.clj: deflean.src/leanfran/dsl.clj: S-expressions → Lean source for deflean.LeanCljTest/: Lean test programs. Vectors.lean holds the diff-test
cases; OracleMain.lean is the native oracle.test/: Clojure tests. test-out/ holds generated code (ignored by git).../../lean-toolchain matches nixpkgs-unstable's lean4.grep -rn 'extern "<symbol>"' under the toolchain's
src/lean) and implement it with the same argument order, dropping erased
arguments.LeanCljTest/Vectors.lean; the diff-test must
match the C backend byte for byte.nix develop ../..#clojure --command make check
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |