The "non-std std lib." Opinionated, domain-shaped Hale libraries
that any app can vendor and reuse inline. Sits between
runtime/stdlib/ (substrate-floor, always-loaded) and one-off
app code.
# in your app's hale.toml
[deps]
pond = { git = "https://github.com/hale-lang/pond", rev = "<commit>" }Pin a commit. The one published tag (v0.8.0) predates most of
the catalog, and pond tracks hale closely enough that "latest" is
not a safe default for an app pinned to an older compiler.
hale fetch// in your .hl files
import "vendor/pond/sqlite" as db;
import "vendor/pond/websocket" as ws;
import "vendor/pond/agent/llm" as llm;
You vendor the whole pond repo, then import only the libs you
use. Each lib lives at its own path under vendor/pond/.
Upstream baseline: hale 0.16.0. Every lib type-checks, tests and runs against it.
CONTRACTS.mdrecords the exact commit each refresh pass builds against, andCOMPILER-BUGS.mdcarries any compiler defects the current pass is blocked on.
Small single-file utility libs consolidating duplicate helpers
surfaced across the main tier libs. Each is a namespace lotus
operating on primitives only. Importable from anywhere — end
apps, other _util libs, and tier libs — since upstream WS3.4
(2026-06-11) closed the old G34 two-hop codegen break.
| Path | What it is | Suggested alias |
|---|---|---|
_util/intfloat/ |
Int ↔ Float bridge — deprecated (use std::math::{int_to_float,float_to_int,round,trunc}) |
intf |
_util/decimal_float/ |
Decimal ↔ Float bridge (matrix emission + wire-format) | decf |
_util/duration_int/ |
Duration → Int ns + monotonic-seconds helpers |
durint |
_util/kvpack/ |
Tab-separated k1=v1\tk2=v2 walker (get/set/has) |
kv |
_util/rowbuf/ |
Tab+newline row-buffer iteration (nth_field, remove_row, ...) | rb |
| Path | What it is | Suggested alias |
|---|---|---|
http/client/ |
HTTP/1.1 client (pool, retry, fallible(IoError)) — superseded by std::http (hale ≥ v0.11.4); kept for older pins |
http |
crypto/ |
HMAC-SHA256/512, SHA-256/512, CSPRNG, hex | crypto |
subprocess/ |
fork/exec wrapper with pipes + timeout | sub |
math/matrix/ |
Dense matrix + matmul + linalg primitives | mat |
math/stats/ |
Mean, var, quantile, online moments | stats |
term/ |
Terminal control: color profiles + styled output (auto-downgrade), ANSI escapes, raw mode — pure Hale over std::term |
term |
| Path | What it is | Suggested alias |
|---|---|---|
db/ |
Backend-neutral DbDriver interface (Go database/sql shape) |
db |
pq/ |
Postgres driver (pgwire v3 over TCP) + connection pool; satisfies DbDriver |
pq |
sqlite/ |
SQLite driver — pure @ffi over system libsqlite3 (Db locus, fallible(DbError); needs libsqlite3-dev to build) + Driver adapter satisfying db::DbDriver |
sqlite |
router/ |
HTTP router with path params + middleware — superseded by std::http::Router (hale ≥ v0.11.4); kept for older pins |
router |
sessions/ |
HMAC-signed cookie sessions | sess |
jobs/ |
Background job queue + worker pool (sqlite-backed) | jobs |
migrations/ |
Schema migration runner (Migrator on db::DbDriver: registered set + up/down/steps/goto/force, per-step txns; the sqlite adapter is sqlite::Driver in sqlite/) |
migs |
| Path | What it is | Suggested alias |
|---|---|---|
logfmt/ |
Structured log sinks (file/OTLP/colored console) for std::log. The file and console sinks are superseded by std::log (hale ≥ v0.11.8); OtlpSink is pond-only and POSTs via std::http |
logfmt |
metrics/ |
Prometheus-format exposition (counter/gauge/histogram) — superseded by std::metrics (hale ≥ v0.11.8); kept for older pins |
metrics |
supervisor/ |
Erlang-style restart strategies on on_failure |
sup |
tracing/ |
Span tree mirroring the locus tower | trace |
| Path | What it is | Suggested alias |
|---|---|---|
websocket/ |
RFC 6455 WebSocket client + server-side upgrade, ping/pong liveness deadlines | ws |
realtime/nats/ |
NATS core + JetStream client, and a std::bus adapter carrying a program's topics over NATS with at-least-once delivery and an ack audit; in-memory fake |
nats |
| Path | What it is | Suggested alias |
|---|---|---|
agent/llm/ |
Anthropic / OpenAI clients with SSE streaming | llm |
agent/tools/ |
Tool registry (Tool interface, F.20 dispatch) | tools |
agent/conversation/ |
Conversation locus (bounded chat history + bus events) | conv |
agent/sandbox/ |
Subprocess-based code-execution sandbox | sandbox |
agent/embeddings/ |
Vector store with top-k search | emb |
ml/neural/ |
Toy dense-layer NN trainer with hand-rolled backprop (XOR-scale; ≤ 4 layers) | nn |
| Path | What it is | Suggested alias |
|---|---|---|
tui/ |
Elm-shaped full-screen TUI runtime: App/Program loop, typed input events (keys/mouse/paste), cell-grid diff renderer, widgets | tui |
The rest of tiers 6–8: messaging (realtime/pubsub,
realtime/cron); game/sim (game/ecs,
game/tick, game/spatial); data formats (data/csv,
data/timeseries, data/pipeline); more DevX (dev/docgen,
dev/asserts, dev/bench). Picked up when a workload demands.
The tree-sitter grammar (heron) moved to its own repo,
hale-lang/tree-sitter-hale
(2026-07-19, full history), so editors and linguist can pin it by
URL. The language server ships in the hale binary itself
(hale lsp).
There is no monorepo build. Each lib is verified on its own, with three gates:
hale check <lib>/ # type-check (libs have no fn main)
hale test <lib>/ # unit tests under <lib>/tests/
hale build <lib>/examples/<demo>/ # then run the binary it emitshale test . runs every lib's tests. A green hale check does not
imply codegen-clean — bare libs never reach codegen — so the test run
and the example are the real gates.
sqlite/ and anything linking it (jobs/, migrations/ demos) need
libsqlite3-dev at build time.
- Each lib is one Hale seed (one directory of
.hlfiles; F.19 per-directory model). - Each lib ships
README.md, source files, a section in the rootFRICTION.log(single consolidated log since 2026-06-12),tests/*_test.hlunit tests (run withhale test <lib>/, orhale test .for the whole repo), andexamples/<demo>/with an agent-runnable demo. - Public surface is locked in
CONTRACTS.md. Implementations must match the contract; deviations get logged in the lib'sFRICTION.logsection and reflected back inCONTRACTS.md. Compiler defects that block a lib are reported separately, inCOMPILER-BUGS.md— reproduced defects only, so it stays usable as an upstream handoff. - No transitive deps in v1 — at the vendoring level: a consumer
that uses
pond/jobs(which usespond/sqlite) must vendor both. Lib-from-lib imports themselves are fine. - Every lib matches the six-pattern catalog (App locus / Namespace lotus / Service / Spawned child / Shape type / Free fn). Things outside the catalog get logged as friction, not coded around.
std::*substrate — JSON, HTTP server, logging, cli, file I/O, tcp, text, test. Always loaded; noimportneeded. Seehale/spec/stdlib.md.- Per-app code — your app's specific business logic lives in your app's repo, not here.
- Cloud SDKs, GUI frameworks, codecs — third-party territory; not bundled.