Repository navigation
v0.11.0
Hew 0.11.0
Building on Hew 0.10.0, this release adds first-class failure
diagnostics and debugger support, more efficient string interpolation, and
robust compilation of long flat expressions. It continues edition 2026.
Complete valid Hew expressions
Completion suggestions use valid source spelling and the appropriate call
context for free functions, static constructors and instance methods.
Suggestions at a bare expression exclude internal runtime functions and retired
builtins. Selected and renamed imports of std.math abs, min and max,
and selected sqrt, compile through the native compiler and browser sandbox.
The compiler does not yet fully enforce private or package visibility for
authored inherent methods across module boundaries. Top-level item visibility
is enforced.
Formatter and installation fixes
The formatter preserves parentheses around grouped machine guards, keeps
consecutive constants together and formats multiline else if chains
consistently. The machine guide corrects its mutable record example and
describes state spread.
The Unix and Windows installers repair incomplete installations. Release
channel checks verify the published npm bytes and stable Homebrew formula.
Inspect actor failures
Crash hooks and trapped actor calls retain an owned CrashInfo with kind, an
optional trap, message, optional site and optional trace. The trace
contains function names, optional source locations and repeat counts; it remains
usable after actor cleanup. failure.backtrace(info) returns the same optional
trace. A missing site or trace is None. When a bounded actor cannot retain all
diagnostic data, the trace is omitted first, then the site, and the message may
be empty. The browser sandbox captures its available function frames; its current
package format does not provide source file and line information.
This changes the actor error payload. Replace a .Trapped arm with
.Trapped(info) (or .Trapped(_) when no details are needed). Hooks that
construct CrashInfo values must also supply trap, site and trace; hooks
that only read kind and message can continue to do so. For example:
import std.failure as failure;
fn report(result: Result<i64, ActorError<Never, Never>>) {
match result {
.Ok(value) => println(value),
.Err(.Trapped(info)) => {
println(info.message);
match failure.backtrace(info) {
.Some(frames) => println(frames.len()),
.None => println("no trace"),
}
}
.Err(_) => println("actor call failed"),
}
}
Distributed failure replies use protocol version 13 to carry the owned facts.
Version 13 peers explicitly reject older protocol versions, including 0.10's
version 12; upgrade communicating nodes together.
Remote requests retain their destination after admission, so an authenticated
withdrawal can remove work that is still queued. A caller's timeout still leaves
the remote outcome uncertain: the handler may already have started or the
withdrawal may be delayed.
Debug a failure
hew debug program.hew starts a native debugger and stops at the common failure
raise after the fault record is published. hew debug --attach PID attaches to
a running process subject to the operating system's permissions. Editor adapters
can use the launch configuration produced by hew debug --print-config.
hew symbolize resolves recorded addresses. DWARF symbols can expand a physical
frame into recoverable inline source locations; PDB lookup currently reports the
physical procedure and source location. Native debug information and split-symbol
release packaging support inspection of optimized and stripped binaries;
optimized locals and physical frames remain subject to compiler optimization.
On Windows, place hew.pdb from the matching debug-symbol archive beside the
SDK's bin/hew.exe to inspect the compiler itself. A program built with -g
has its own PDB beside its executable.
Failure records retain their source and symbol identity across loaded-image
cleanup. Native trace capture follows HEW_BACKTRACE; the browser VM captures
available frames at the failure origin. Existing Observe tools remain available
for process inspection.
Format strings with fewer allocations
Native and browser sandbox interpolation now append primitive values and literal
text directly to the result, reducing temporary strings and repeated joins while
preserving expression and Display call order. Empty and lone interpolation keep
their ordinary rendering paths.
Interpolation uses ordinary string growth, so results can retain spare capacity.
A bounded actor can therefore reach its heap limit at a different point, even
when formatting allocates fewer times overall.
Compile long flat expressions
The browser compiler now handles long binary-operator runs and pattern
alternatives without recursing once per term. Evaluation order, short-circuit
behaviour, intermediate overflow checks and owned-value cleanup remain the same.
Genuinely nested expressions still receive the existing nesting diagnostic.