Skip to content

BHC v0.2.2

Latest

Choose a tag to compare

@github-actions github-actions released this 26 May 19:03
9e7f59d

BHC v0.2.2

The first release of 2026 with material progress against
real-world Haskell. v0.2.2 is a stability-and-coverage release —
the headline numbers move, the REPL becomes booth-usable, and the
release tarball finally ships the standard library it needs to
link a hello-world.

Highlights

  • Pandoc — bhc check: 78 / 221 modules pass (up from
    4 / 221 at v0.2.1).
    The parser sees all 221 modules; 91 still fail in lowering or
    type-checking and 52 are skipped pending external-package support.
    Live numbers on the status page.
  • zentinel-agent-policy — 10 / 10 modules compile. The full
    Zentinel.Agent.Policy.* graph goes through the multi-module
    pipeline and emits object code. See
    the milestone post.
  • bhci REPL is now usable. Pure-expression evaluation, recursive
    let, persistent bindings, list comprehensions, polymorphic
    arithmetic, accurate type display. See the
    REPL section in the demos folder.
  • Install path repaired. v0.2.1 tarballs shipped without the
    standard library, so curl install.sh | sh left users one
    hello-world away from a link error. Fixed.

What got better

Language coverage

  • Multi-module pipeline with cross-module type propagation, circular
    imports, qualified-name resolution, re-export handling, and ~120
    builtin module stubs (Data.Text, transformers, ByteString, Map, Set,
    Sequence, Djot, Skylighting, DocLayout, and more).
  • Existential types end-to-end (parser → typechecker → codegen with
    dictionary dispatch).
  • Multi-argument class methods, RankNTypes, multi-line export
    lists
    , alias-qualified imports.
  • Layout rule edge cases: VirtualRBrace before in, qualified
    constructors at the start of pattern bindings, multi-line Haddock
    collection.
  • Parser correctness fixes: backtick infix precedence, !/?/#
    as binary operators, Haddock comments before module, tuple
    constructors up to 15-tuples, char literal lexing, nested where
    clauses, parameterised CPP/diagnostics in the loader.

Evaluator

  • /= was an alias for == and returned wrong results everywhere it
    appeared in source. Now properly negates equality.
  • +, -, *, negate were hardcoded to integer arithmetic; calling
    them on Float or Double either errored or silently returned 0.
    Now polymorphic across Int, Integer, Float, Double.
  • REPL let dispatch no longer misroutes let f n = ... in f 5 as a
    binding declaration.
  • Type display in bhci no longer prints t586 for unresolved
    schemes; falls back to the runtime value shape and recurses into
    lists, tuples, Maybe, and Either.

Packaging

  • Release tarball now contains all nine stdlib static libraries
    (libbhc_text.a, libbhc_base.a, libbhc_prelude.a, ...) in
    addition to libbhc_rts.a. Sizes up from ~39 MB to ~96 MB
    compressed; the alternative was broken installs.
  • Workflow fails loudly if any of the four critical archives (rts,
    text, base, prelude) is missing.

Compatibility

This release stays within the documented Haskell baseline. The
compatibility charter covers
the GHC2021 / GHC2024 subset BHC currently supports. Template Haskell
remains out of scope.

Known issues

A few rough edges are documented honestly rather than hidden:

  • let t = expr; describe t inside a do block routes user class
    methods through an RTS stub
    instead of dispatching on the
    user-supplied instance. Workaround: invoke the class method on the
    value directly, or via a top-level binding. Will be fixed in the
    next release.
  • Recursive where-bound helpers with guards can segfault under
    native compilation in some shapes. Workaround: hoist the helper to a
    top-level function.
  • WebAssembly binaries validate against wasmtime but the Core IR
    → WASM lowering for general programs is incomplete. WASM E2E tests
    are 0 / 6.
  • GPU backends pass mock-mode tests (2 / 2 PTX) but require CUDA
    hardware for real end-to-end testing.

Installation

# Recommended (Linux / macOS):
curl -fsSL https://arcanist.sh/bhc/install.sh | sh

# Or via Homebrew:
brew install arcanist-sh/tap/bhc

# Then:
echo 'main = putStrLn "Hello!"' > hello.hs
bhc hello.hs -o hello
./hello

Platforms

This release includes binaries for:

  • Linux x86_64
  • macOS aarch64 (Apple Silicon)

Linux aarch64, macOS x86_64 (Intel), and Windows are not yet packaged.

Checksums

See SHA256SUMS.txt for file checksums.

Coming up

The next release will focus on type-checking failures in modules that
currently cross lowering but stall on partial stub typing, and on the
two native-codegen bugs noted above. Pandoc compatibility numbers will
keep moving as those land.