Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
This PR is a follow up to #8055 and implements a `Selector` for async TCP in order to allow IO multiplexing using TCP sockets. As we must not commit to actually fetching data from the socket buffer this cannot be implemented by just racing on `recv?`. Instead we perform a call to `uv_read_start` and pass an `alloc_cb` that allocates no memory at all. According to the docs of [`uv_alloc_cb`](https://docs.libuv.org/en/v1.x/handle.html#c.uv_alloc_cb) this is guaranteed to give us a `UV_ENOBUFS` in the relevant callback. Thus we can first run this "zero read" and then go into one of three cases: 1. We get cancelled before the zero read completes, in this case just cancel the zero read and give up. 2. The zero read completes and we loose the race for completing the `select`, in this case just don't do anything anymore 3. The zero read completes and we win the race for completing the `select`, in this case we perform the actual read on the socket. As we know that data is available already (since the read callback of the zero read is only triggered if data actually is available) we know that the subsequent actual read should complete right away. In this way we avoid any data loss if we loose the race. |
||
|---|---|---|
| .github | ||
| doc | ||
| images | ||
| nix | ||
| 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
- FAQ
Installation
See Setting Up Lean.
Contributing
Please read our Contribution Guidelines first.
Building from Source
See Building Lean (documentation source: doc/make/index.md).