100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
Programming

Hare (language)

Created by Drew DeVault

AdvancedLanguage11.1K learners

Hare is a small, simple, low-level systems programming language with manual memory management, designed as a modern alternative to C for writing operating systems, compilers, and other performance-critical software.

#Hare#Language#Programming#Advanced#Rust#Zig#Compiler#SoftwareDevelopment#Glossary#SkillVeris

Definition

Hare is a small, simple, low-level systems programming language with manual memory management, designed as a modern alternative to C for writing operating systems, compilers, and other performance-critical software.

Overview

Hare was created by Drew DeVault (also known for the sway window manager and the SourceHut hosting platform) as a deliberately minimal systems language intended to fill a niche between C's simplicity and more complex modern systems languages like Rust or Zig. Its explicit design philosophy prioritizes a small, stable, fully specified language over feature richness: Hare has no hidden control flow, no exceptions, no generics via runtime polymorphism, no operator overloading, and no build-time metaprogramming beyond simple constants, aiming to keep the entire language and its behavior easy to hold in one's head and easy to audit. Memory in Hare is managed manually, similarly to C, without a garbage collector and without Rust's compile-time ownership/borrow-checking system. This makes Hare's memory-safety guarantees weaker than Rust's, a tradeoff the project accepts deliberately in exchange for simplicity and predictability of compiled output. Hare does add modern conveniences C lacks by default: a built-in slice type with bounds checking, tagged unions, defer statements for cleanup, first-class error handling via result/error types (avoiding C's convention of overloaded return codes), and a module system. Hare compiles to native code via its own QBE-based backend and is intended to produce small, statically linked binaries with minimal runtime dependencies, making it attractive for operating-system-level work, custom kernels, bootloaders, and other bare-metal or resource-constrained contexts. It ships with its own standard library covering things like POSIX bindings, networking, and cryptography, written entirely in Hare, and is developed openly on SourceHut with a strong ethos around software minimalism, self-hosting toolchains, and avoiding external dependencies. Hare targets Linux primarily (with growing support for other platforms) and, being a young and intentionally slow-moving project, has a comparatively small but committed contributor community focused on long-term stability of the language specification itself.

Key Features

  • Minimal, fully specified language with no hidden control flow or implicit behavior
  • Manual memory management, similar to C, with no garbage collector or borrow checker
  • Built-in bounds-checked slices, tagged unions, and defer statements
  • First-class, explicit error handling via result/error types instead of C-style return-code conventions
  • Compiles to native code through its own QBE-based backend
  • Produces small, statically linked binaries suited to systems and bare-metal programming
  • Standard library written entirely in Hare, covering POSIX, networking, and cryptography
  • Developed with an explicit philosophy of simplicity, stability, and minimal external dependencies

Use Cases

Writing operating system kernels, bootloaders, and other bare-metal software
Building compilers, interpreters, and other systems tooling
Replacing C in projects that want more modern ergonomics without adopting a large, complex language
Resource-constrained or embedded environments needing small, predictable binaries
Projects prioritizing a small, auditable language specification over feature breadth

Alternatives

CZigRustOdin

Frequently Asked Questions