A systems programming language for environments where failure is not an option.
Blood synthesizes five cutting-edge programming language innovations:
- Content-Addressed Code (Unison) — Code identity via BLAKE3-256 hashes
- Generational Memory Safety (Vale) — Fat pointer refs with generation tracking, no GC
- Hybrid Ownership Model (Hylo + Rust + Vale) — Mutable value semantics with escape-analyzed allocation, no borrow checker
- Algebraic Effects (Koka) — All side effects typed and composable
- Multiple Dispatch (Julia) — Type-stable open extensibility
Pre-release — research compiler. No version tag yet. See KNOWN_LIMITATIONS.md for the honest status of each component.
The self-hosted compiler passes 543/543 golden tests. It compiles itself through a three-generation byte-identical bootstrap, and the resulting binary has no Rust runtime dependency — the seed is self-sufficient and requires only LLVM 18 on the host.
| Component | Status | Details |
|---|---|---|
| Lexer & Parser | ✅ Working | 90% of normative grammar claims verified in code |
| Type Inference | ✅ Working | Algorithm W, bidirectional, 100% of normative claims verified |
| Type Checking | ✅ Working | Linearity, effects, exhaustiveness, generic impls |
| Code Generation | LLVM IR emission. Known gap: aggregate escape analysis disabled | |
| Effects System | ✅ Working | Deep/shallow handlers, perform/resume, snapshots, per-op resume |
| Memory Model | Generational refs for heap/region. Stale &str detection for String buffers currently disabled pending a latent bug fix | |
| Runtime | ✅ Working | 181KB Blood-native runtime (no Rust). Memory, effects, VFT |
| Multiple Dispatch | Compile-time dispatch works. Runtime dispatch (fingerprint-based) is deferred | |
| Fibers / Concurrency | ❌ Not integrated | pthread-based spawn; no M:N scheduler, no mutex/channel primitives wired |
| Safety Checks | ✅ Default | Definite init, linearity, bounds, dangling ref rejection all enabled |
| Content Addressing | 🔶 Partial | BLAKE3 hashing, codebase storage. VFT dispatch wiring not hooked up |
| Formal Proofs | ✅ Complete | 264 Coq theorems/lemmas, 0 Admitted, 0 Axioms (covers a simplified model of the language, not the compiler artifact) |
Legend: ✅ Working |
Spec coverage (approx): 39 of 78 surveyed normative claims across docs/spec/*.md have verifiable code evidence today (~50%). See KNOWN_LIMITATIONS.md for the full breakdown by spec file and the known soundness gaps that remain open.
Tutorial | Specification | Known Limitations | Contributing
In engineering, regulations "written in blood" are those born from catastrophic failures — rules that exist because someone died or systems failed in ways that can never be allowed again.
Blood is for avionics, medical devices, financial infrastructure, autonomous vehicles, nuclear control systems. Systems where failure is not an option.
- No Hidden Costs — Every abstraction has predictable, visible cost
- Failure is Data — All errors tracked in the type system via effects
- Zero-Cost When Provable — Compile-time proofs eliminate runtime checks
- Effects are Universal — IO, state, exceptions, async — one unified mechanism
- Interop is First-Class — C FFI designed from day one
This is a monorepo containing both the Blood language project and the Rust bootstrap compiler.
blood/
├── stdlib/ # Standard library (Blood source)
│ ├── core/ # Core types (Option, String, Box, etc.)
│ ├── collections/ # Vec, HashMap, LinkedList, etc.
│ ├── effects/ # Effect system primitives
│ ├── sync/ # Concurrency primitives
│ └── ...
├── src/
│ ├── bootstrap/ # Rust bootstrap compiler (Rust)
│ │ ├── bloodc/src/ # Compiler source (Rust)
│ │ └── Cargo.toml # Workspace manifest
│ └── selfhost/ # Self-hosted compiler (written in Blood)
├── docs/ # Language specification & documentation
│ ├── spec/ # Core language specifications
│ ├── design/ # Design evaluations and decisions
│ ├── planning/ # Roadmaps, status, decisions
│ ├── internal/ # Compiler internals
│ └── ...
├── examples/ # Blood language examples
└── tools/ # Development & debugging tools
See src/bootstrap/README.md for Rust-compiler-specific details.
effect Error<E> {
op raise(err: E) -> !
}
effect IO {
op read_file(path: Path) -> Bytes
}
fn load_config(path: Path) -> Config / {IO, Error<ParseError>} {
let data = read_file(path)
parse_config(data)
}
fn main() / {IO, Error<AppError>} {
let config = with ParseErrorHandler handle {
load_config("config.toml")
}
run_app(config)
}
# Build the compiler from the bootstrap seed (requires LLVM 18)
cd src/selfhost
./build_selfhost.sh build first_gen
# Compile and run a program
build/first_gen run ../../examples/fizzbuzz.blood
# Development workflow: edit source, rebuild incrementally, test
./build_selfhost.sh build second_gen # Incremental self-compilation
./build_selfhost.sh test golden second_gencd src/bootstrap
cargo build --release
cargo run -- run ../../examples/fizzbuzz.bloodSee the Specification for language details.
| Document | Description |
|---|---|
| SPECIFICATION.md | Core language specification |
| MEMORY_MODEL.md | Synthetic Safety Model (generational references) |
| DISPATCH.md | Multiple dispatch and type stability |
| GRAMMAR.md | Complete surface syntax grammar |
| FORMAL_SEMANTICS.md | Operational semantics and type rules |
| Document | Description |
|---|---|
| CONTENT_ADDRESSED.md | Content-addressed storage and VFT |
| CONCURRENCY.md | Fiber model and scheduler |
| FFI.md | Foreign function interface |
| STDLIB.md | Standard library design |
| DIAGNOSTICS.md | Error messages and diagnostics |
| Document | Description |
|---|---|
| ROADMAP.md | Implementation plan and milestones |
| DECISIONS.md | Architecture decision records |
| IMPLEMENTATION_STATUS.md | Detailed implementation audit |
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
We welcome contributions! See the implementation status for areas that need work.
- Bug reports: Open an issue with reproduction steps
- Feature requests: Open a discussion first
- Code contributions: Fork, branch, and submit a PR
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.