Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
This PR adds the experimental `idbg e`, a new do-element (and term) syntax for live debugging between the language server and a running compiled Lean program. When placed in a `do` block, `idbg` captures all local variables in scope and expression `e`, then: - **In the language server**: starts a TCP server on localhost waiting for the running program to connect; the editor will mark this part of the program as "in progress" during this wait but that will not block `lake build` of the project. - **In the compiled program**: on first execution of the `idbg` call site, connects to the server, receives the expression, compiles and evaluates it using the program's actual runtime values, and sends the `repr` result back. The result is displayed as an info diagnostic on the `idbg` keyword. The expression `e` can be edited while the program is running - each edit triggers re-elaboration of `e`, a new TCP exchange, and an updated result. This makes `idbg` a live REPL for inspecting and experimenting with program state at a specific point in execution. Only when `idbg` is inserted, moved, or removed does the program need to be recompiled and restarted. # Known Limitations * The program will poll for the server for up to 10 minutes and needs to be killed manually otherwise. * Use of multiple `idbg` at once untested, likely too much overhead from overlapping imports without further changes. * `LEAN_PATH` must be properly set up so compiled program can import its origin module. * Untested on Windows and macOS. |
||
|---|---|---|
| .claude | ||
| .github | ||
| doc | ||
| images | ||
| releases_drafts | ||
| script | ||
| src | ||
| stage0 | ||
| tests | ||
| .gitattributes | ||
| .gitignore | ||
| .gitpod.Dockerfile | ||
| .gitpod.yml | ||
| .ignore | ||
| CMakeLists.txt | ||
| CMakePresets.json | ||
| CODEOWNERS | ||
| CONTRIBUTING.md | ||
| flake.lock | ||
| flake.nix | ||
| lean-toolchain | ||
| lean.code-workspace | ||
| LICENSE | ||
| LICENSES | ||
| README.md | ||
| RELEASES.md | ||
This is the repository for Lean 4.
About
- Quickstart
- Homepage
- Theorem Proving Tutorial
- Functional Programming in Lean
- Documentation Overview
- Language Reference
- Release notes starting at v4.0.0-m3
- Examples
- External Contribution Guidelines
Installation
See Install Lean.
Contributing
Please read our Contribution Guidelines first.
Building from Source
See Building Lean.