Hare 2022
A simple, stable, robust systems language - manual memory, a small spec, and no GC: a leaner alternative to C.
Influenced by: C Zig go rust
Hare is a systems programming language designed to be simple, stable, and robust. It pairs a static type system with manual memory management and a minimal runtime - no garbage collector, no hidden allocations - so memory is your responsibility, freed explicitly and cleaned up with defer. Most similar to C and able to express almost anything C can, Hare deliberately keeps a small, freezable specification and compiles through the lightweight QBE backend, aiming to be a leaner, more modern alternative to C.
What makes it distinctive
- Manual memory management, no garbage collector - you allocate and free explicitly; there is no GC, no reference counting, and no hidden runtime managing the heap. Allocation is done with the built-in
allocexpression and released withfree, giving deterministic, predictable memory behaviour like C. deferfor cleanup - statements can be deferred to run when the enclosing scope exits (e.g.defer free(buf);ordefer io::close(file)!;), a Zig/Go-style mechanism that keeps allocation and release close together without RAII destructors.- Minimal runtime, no hidden costs - Hare ships only a tiny runtime; there are no exceptions, no implicit allocations, and (when linking libc) heap allocation goes straight through
malloc. What you write is close to what runs. - Tagged unions - first-class sum types written as
(i32 | f32)carry a tag plus enough space for any member; theisoperator tests the active type andasextracts it, enabling safe, explicit variant handling and idiomatic error-as-value returns. - Slices and bounded arrays - slices such as
[]u8bundle a pointer with a length, so buffer sizes travel with the data instead of being passed separately, reducing a major class of C buffer bugs. - A small, freezable specification - the entire language is specified in a deliberately compact document, with the explicit goal of stabilizing and freezing the spec at 1.0 so Hare programs keep building unchanged for decades.
- QBE backend instead of LLVM - compiling through the compact QBE backend keeps the toolchain small, quick to bootstrap, and dependency-light while still producing optimized native code for x86_64, aarch64, and riscv64.
- Strong C interoperability - Hare is most similar to C and can call into C libraries and the system ABI directly, making it practical for operating systems, system tools, compilers, and networking software.
History
Hare was created by Drew DeVault, the founder of SourceHut, and announced publicly on 25 April 2022 after roughly two years of private development by DeVault and a group of contributors. The motivation was a reaction to two trends DeVault saw in systems programming: C's accumulating complexity and undefined-behaviour foot-guns, and the heavyweight machinery (borrow checker, large toolchains, large specifications) of newer languages like Rust. Hare's answer is radical minimalism - a language small enough that its complete specification fits in a slim document and could eventually be frozen.
A defining engineering decision was the choice of backend. Rather than depend on LLVM, Hare compiles through QBE, a small optimizing compiler backend written by Quentin Carbonneaux that targets x86_64, aarch64, and riscv64 and aims for roughly 70% of LLVM's performance in about 10% of the code. This keeps the whole Hare toolchain compact, fast to build, and easy to bootstrap. The toolchain is free software, hosted on SourceHut, and the project deliberately favours Linux and the BSDs while declining to support Windows or macOS as part of its commitment to a free-software ecosystem.
Hare originally went without conventional version numbers, but on 16 February 2024 the project shipped Hare 0.24.0 and adopted a calendar-style quarterly release policy (versions of the form 0.YY.Q). As of the mid-2020s Hare remains pre-1.0 and intentionally unstable: the maintainers reserve the right to make breaking changes - some potentially dramatic - on the road to a future 1.0 that will freeze the grammar and semantics for long-term permanence. A standardization effort toward that frozen specification was announced in late 2023. Leadership of the project has broadened over time, with maintainer Ember Sawady among those carrying it forward alongside DeVault and a community of contributors.