Downloads

Get Reef v0.11.1

Prebuilt tarballs from the object store. Filter by version, OS, and architecture.

Reef is experimental, and releases can break compatibility with each other. Pin a specific version rather than tracking the latest.

Version OS Arch Download
0.11.1 macOS arm64 reef-lang-0.11.1-darwin-arm64.tar.gz
0.11.1 freebsd amd64 reef-lang-0.11.1-freebsd-amd64.tar.gz
0.11.1 Linux amd64 reef-lang-0.11.1-linux-amd64.tar.gz
0.11.1 netbsd amd64 reef-lang-0.11.1-netbsd-amd64.tar.gz
0.11.1 openbsd amd64 reef-lang-0.11.1-openbsd-amd64.tar.gz
0.11.0 macOS arm64 reef-lang-0.11.0-darwin-arm64.tar.gz
0.11.0 freebsd amd64 reef-lang-0.11.0-freebsd-amd64.tar.gz
0.11.0 Linux amd64 reef-lang-0.11.0-linux-amd64.tar.gz
0.11.0 netbsd amd64 reef-lang-0.11.0-netbsd-amd64.tar.gz
0.11.0 openbsd amd64 reef-lang-0.11.0-openbsd-amd64.tar.gz
0.10.7 macOS arm64 reef-lang-0.10.7-darwin-arm64.tar.gz
0.10.7 freebsd amd64 reef-lang-0.10.7-freebsd-amd64.tar.gz
0.10.7 Linux amd64 reef-lang-0.10.7-linux-amd64.tar.gz
0.10.7 netbsd amd64 reef-lang-0.10.7-netbsd-amd64.tar.gz
0.10.7 openbsd amd64 reef-lang-0.10.7-openbsd-amd64.tar.gz
0.10.6 macOS arm64 reef-lang-0.10.6-darwin-arm64.tar.gz
0.10.6 freebsd amd64 reef-lang-0.10.6-freebsd-amd64.tar.gz
0.10.6 Linux amd64 reef-lang-0.10.6-linux-amd64.tar.gz
0.10.6 netbsd amd64 reef-lang-0.10.6-netbsd-amd64.tar.gz
0.10.6 openbsd amd64 reef-lang-0.10.6-openbsd-amd64.tar.gz
0.10.5 Linux amd64 reef-lang-0.10.5-linux-amd64.tar.gz
0.10.4 Linux amd64 reef-lang-0.10.4-linux-amd64.tar.gz
0.10.2 Linux amd64 reef-lang-0.10.2-linux-amd64.tar.gz
0.10.1 Linux amd64 reef-lang-0.10.1-linux-amd64.tar.gz
0.10.0 Linux amd64 reef-lang-0.10.0-linux-amd64.tar.gz
0.9.3 Linux amd64 reef-lang-0.9.3-linux-amd64.tar.gz
0.9.2 Linux amd64 reef-lang-0.9.2-linux-amd64.tar.gz
0.9.1 Linux amd64 reef-lang-0.9.1-linux-amd64.tar.gz

SHA256SUMS

Release notes — Reef v0.11.1

Released 2026-10-19 · What's fixed, changed, and new since v0.11.0
Full ChangeLog →

Highlights

Reef 0.11.1 adds one runtime hook for OS entropy, reef_rt_entropy. It uses getrandom on Linux and illumos, arc4random_buf on the BSDs and macOS, and /dev/urandom elsewhere, and it never falls back to the clock. Two new modules build on it. random.random has secure functions that return a Result and a seedable Pcg32 generator for reproducible sequences. encoding.uuid covers RFC 9562 v4, v5, v7, v8, nil and max, and is tested against the RFC's vectors. math.random has fixes that change seeded output: the same seed(n) now gives different random_int_max, random_int_range and random_float results than 0.11.0. On bare metal, math.random now links in a freestanding image and a kernel can override the default reef_panic.

Details

Added — reef_rt_entropy: one OS entropy hook (RB-016)

  • The runtime has one entropy primitive, reef_rt_entropy(buf, len) (reef-runtime/include/reef_entropy.h). Linux and illumos use getrandom(2), the BSDs and macOS arc4random_buf(3), anything else /dev/urandom (also the fallback when the kernel lacks getrandom). It fills every byte or returns a code (1 no source, 2 source failed, 3 bad arguments) with the buffer zeroed. It never falls back to the clock. EINTR from the GC's SIGURG is retried.
  • Bare metal: reef_baremetal.c has a weak default that returns "no source". An OS links its own reef_rt_entropy to provide one, as it does reef_putchar.
  • Reef code reaches it through sys.platform.runtime.reef_rt_entropy. Prefer the random module, which returns a Result.
  • Link test: a strong reef_rt_entropy overrides the weak bare-metal default on amd64 (run and checked by behaviour), aarch64 and riscv64 (checked with nm), with no duplicate-symbol error. If the strong definition is in a static archive linked after reef_baremetal.o, the linker never pulls it in and the weak default is used silently. reef-baremetal/README.md gives the safe link lines (object file, or --whole-archive).

Added — encoding.uuid (RFC 9562) (RB-019)

  • v4() and v7(unix_ms) take their random bits from random.random and return a Result (Err(Unsupported) with no entropy source, never a predictable UUID). v7 puts the 48-bit millisecond time first, so UUIDs from different milliseconds sort by time.
  • v8(bytes) sets the version and variant bits over the caller's 16 bytes (the caller's array is not changed). v5(namespace, name) is SHA-1 name-based via crypto.sha1, with namespace_dns/url/oid/x500. nil_uuid() and max_uuid() (nil is a reserved word).
  • parse accepts only the canonical 8-4-4-4-12 form (either case); format writes lower case. from_bytes / to_bytes use RFC byte order, the order of the ext2/ext4 s_uuid field. Also version, variant, is_nil, is_max, eq, compare.
  • Tested against the RFC 9562 Appendix A vectors (v4, v5, v7, v8).
  • v4, v8 and to_bytes compile and link for bare metal.

Added — random.random: secure random numbers and a seedable PCG32 (RB-018)

  • secure_fill, secure_bytes, secure_u32, secure_u64, secure_below, secure_range (inclusive) and secure_float read the OS source through reef_rt_entropy and return a Result: Err(Unsupported) when the target has no source, Err(IoError) when it fails, Err(InvalidInput) for bad arguments. No silent fallback.
  • Pcg32 is a seedable, deterministic generator (PCG-XSH-RR 64/32, bit-identical to pcg-c-basic): pcg32_new(seed, stream), pcg32_from_entropy, pcg32_next_u32/u64, pcg32_below, pcg32_range, pcg32_float, pcg32_bool, pcg32_shuffle. Each generator has its own state, so Active Objects do not share one. Not for secrets.
  • Ranges are unbiased (rejection sampling) and floats are in [0, 1).
  • Bare metal: reef_baremetal.h has reef_array_length, so modules that call arr.length() (this one, encoding.uuid) compile freestanding.

Changed — math.random: fixes that change seeded sequences (RB-020)

The same seed(n) now gives different random_int_max, random_int_range and random_float results than in 0.11.0. Raw random_int() and random_bool() sequences do not change.

  • random_float() could return exactly 1.0 (the divisor was 2^31-1, the largest draw; seed(1584200935) hit it on the first call). It now divides by 2^31, so results are always in [0.0, 1.0).
  • random_int_max and random_int_range were biased (random_int() % n favoured small results: for max = 1500000000, values below 647483648 came up 60% of the time instead of 43%). They now use rejection sampling over the full 32-bit draw.
  • random_int_range overflowed for spans over 2^31-1: it returned values outside the range, and random_int_range(INT_MIN, INT_MAX) panicked with integer division by zero. Any int span now works.
  • seed_time() seeded from the clock in whole seconds, so programs started in the same second got the same sequence. It now seeds from reef_rt_entropy and uses the clock only when the target has no entropy source. math.random is still not for secrets; use random.random.

Fixed — bare-metal reef_panic can be overridden (RB-022)

  • The default reef_panic in reef-baremetal/src/reef_baremetal.c was a strong definition, although the README and header comments called it an optional override. A kernel that defined its own reef_panic and linked that file failed with a duplicate symbol (multiple definition in GNU ld, duplicate symbol in ld.lld). It is now weak, like the other hooks. The weak-override link test covers it on amd64 (run and checked by behaviour), aarch64 and riscv64 (checked with nm).
  • reef_baremetal defines reef_time (weak, returns 0 = no clock; an OS with an RTC overrides it) and reef_int_to_float (inline). Before, a freestanding image that called math.random.seed_time() or random_float() failed to link with undefined references to both.
  • New gate in run_tests.sh: random_link_probe.reef links against reef_baremetal.c on amd64, aarch64 and riscv64, and a strong reef_rt_entropy must override the weak default.