Hare 0.26.3 released December 1, 2026 by Drew DeVault

I am pleased to announce the release of Hare 0.26.3 today. 🎉 This release includes numerous bug fixes and a handful of new features for the language and standard library. Let’s go over the highlights together.

Hare 0.26.3

Release notes
Hare 0.26.3
Download
compiler harec-0.26.3.tar.gz • stdlib hare-0.26.3.tar.gz

This release does not include a companion hare-update release.

Hare 0.26.3 is compatible with version 1.3 of qbe.

New here? Hare is a systems programming language designed to be simple and robust, using a static type system, manual memory management, and a minimal runtime. You can learn about it here.

Regarding the next release

The next Hare release will include the “mutability overhaul”, which is expected to break virtually all Hare code. We will ship hare-update rules to make it easier to migrate affected code, but be aware that some manual intervention will still likely be required.

Release highlights

More flexible Hare module configuration (hare.ini)

Hare’s simple tag-based system of organizing Hare modules has served us well for a long time, but it’s not flexible enough to comfortably handle a lot of different situations. To refresh your memory, Hare modules often look something like this:

mymodule/
  +linux/
    linux_impl.ha
  +freebsd/
    freebsd_impl.ha
  utils+x86_64.ha
  utils+aarch64.ha
  portable.ha

Modules can still be organized like this by default, these are now “automatic” modules. However, if you want to fine-tune the module assembly process, you can now add a hare.ini file to your module root. Using this, you can:

This should make it a lot easier to configure and re-use code targetting many different platform configurations. Here’s a (trimmed down) example of the rt:: module from the standard library:

sources = abort.ha entry.ha initfini.ha u64tos.ha ensure.ha env.ha globals.ha
sources = memfunc_ptr.ha memcpy.ha memmove.ha memset.ha strcmp.ha
sources = hare.sc

[+libc]
def WITH_LIBC = true
sources = libc/exit.ha libc/start.ha libc/malloc.ha

[+libc -test]
sources = libc/main.ha

[+test]
def WITH_TEST = true
sources = test/main.ha

# Included if no rules have been matched prior to this point:
[^]
sources = main.ha

[-libc]
sources = malloc.ha heap.ha exit.ha

[+linux]
sources = abort_posix.ha
[+linux -libc]
sources = start_sysv.ha alloc_mmap.ha
[+linux +x86_64]
sources = linux/x86_64/restore.s
[+linux +x86_64 -libc]
sources = linux/x86_64/start.s

[+freebsd]
sources = abort_posix.ha freebsd/brand.s
[+freebsd -libc]
sources = start_sysv.ha alloc_mmap.ha
[+freebsd +x86_64 -libc]
sources = freebsd/x86_64/start.s

# ...continued...

Another example comes from hare-sdl3, which is simple:

sources = *.ha
dependencies = sdl3

With this simple change, hare build will now automatically consult pkg-config for the necessary flags to link with SDL3, so one needn’t manually link to dependencies which are managed by an integration module.

One can also handle weirder dependency configurations, like SDL2’s special snowflake pkg-config replacement:

sources = *.ha
libs = $(sdl2-config --libs)

For details on using hare.ini yourself, consult the new hare.ini(5) man page after updating Hare.

if..let expressions

Consider the following match expressions:

match (x) {
case let x: int =>
    // ...
case => void;
};

match (x) {
case let x: int =>
    // ...
case =>
    // ...
};

In these simple cases, where there’s only one meaningful branch, or one branch plus a catch-all, we have introduced the more concise “if..let” syntax. Both of these can be simplified thusly:

if (let x: int = x) {
    // ...
};

if (let x: int = x) {
    // ...
} else {
    // ...
};

Improvements to match-like semantics

We took advantage of the compiler refactoring necessary to support if..let to make more general improvements to “match-like” semantics throughout Hare – is and as expressions are now routed through the same codegen as match and if..let. The upside of this is that you can now, for example, use as on pointers:

let x: (int | uint) = 10i;
let y = &x as *int;

@defined expressions

A simple improvement, as part of our research into expanding the compile-time features of Hare: @defined(ident) can be used to test if a given symbol is defined in the scope in which it appears.

X.509 support

The Hare standard library now includes the crypto::x509 module – a big step forward in efforts towards Hare-native TLS support. This module provides certificate parsing and validation, and imports the system certificate store. It’s not entirely complete, currently lacking support for creating new certificates, and dealing with certificate revocation. Nonetheless it is a remarkable achievement from our resident crypto expert, Armin :)

statvfs and fstatvfs support

The os:: module now supports statvfs and fstatvfs functions, which can be used to query filesystem statistics (e.g. number of inodes, mount path, etc).

Multicast support for net::

The net:: module now offers support for joining and leaving multicast groups for IPv4 and IPv6.

Breaking changes

Hare users may be impacted by the following breaking changes:

Splitting up rt::

The low-level portions of the standard library have been split into three separate modules:

If your Hare code directly makes syscalls or otherwise digs into rt:: to get its work done, you may have to move your symbol references to the appropriate namespace.

types::c:: removals

The types::c:: module has removed (u)int_least_t and (u)int_fast_t.

debug::backtrace

This function now accepts an I/O handle to write backtraces to, rather than unconditionally writing them to os::stderr. It now returns errors as well.

shlex

shlex::quotestr can now return nomem.

strconv

String to integer conversion functions no longer accept a leading “+” symbol in the input.

hare::parse::doc

hare::parse::doc now requires the user to provision their own bufio::scanner for the input, rather than handling this itself.

fs::iter

fs::iter has been reworked to remove the ftype field, which is not consistently available on all filesystems or operating systems. fs::dirent_type is now available to retrieve the same information, falling back on stat if necessary.

crypto::blake2

crypto::blake2b has been renamed to crypto::blake (and blake2s support has been implemented in the same module).

bufio::newscanner_buf

bufio::newscanner_static has been renamed to bufio::newscanner_buf.

math::fenv

The math::fenv family of functions has been removed, as there is no way to concretely implement them without invoking undefined behavior.