This is from a ~~pair~~triple programming session with @tydeu and @mhuisi. If stage 1 is built with `-DUSE_LAKE=ON`, the CMake run will generate `lakefile.toml` files for the root, `src`, and `tests`. These Lake configuration files can then be used to build core oleans. While they do not yet allow Lake to be used to build the Lean binaries. they do allow Lake to be used for working interactively with the Lean source. In our preliminary experiments, this allowed updates to `Init.Data.Nat` to be noticed automatically when reloading downstream files, rather than requiring a full manual compiler rebuild. This will make it easier to work on the system. As part of this change, Lake is added to stage 0. This allows Lake to function in `src`, which uses the stage 0 toolchain. --------- Co-authored-by: Mac Malone <tydeu@hatpress.net> Co-authored-by: Sebastian Ullrich <sebasti@nullri.ch> |
||
|---|---|---|
| .. | ||
| Main | ||
| .gitignore | ||
| Main.lean | ||
| Makefile | ||
| myfuns.cpp | ||
| README.md | ||
Small project implemented using Lean and C++.
The C++ file myfuns.cpp wraps a C++ object using an lean_external_object.
The file myfuns.cpp exposes pure and effectful primitives.
The file Main.lean contains a small Lean program that uses the exported primitives.
Build instructions
Assuming the Lean bin/ directory (e.g. from build/release/stage1) is in your PATH,
executing leanmake build/bin/test will create the executable build/bin/test; see the
Makefile for further variants.
The executable build/bin/test should produce the output
30
hello
foobla
world