Hew
A language that expects failure.
Hew compiles actor-based programs to native code. Each actor owns its state, and supervisors decide how failed actors restart.
State stays with the actor
This session actor owns its message vector. post is the only code here that mutates the vector, and each call waits for the handler to finish before returning a Result.
count reads the same private state and returns its value to the caller. The error arm stays visible because an actor may have stopped before the call completes.
// A chat session is an actor: state lives in fields and only its handlers
// can mutate it. Ordinary actor calls wait for the handler and return a
// Result, whether or not the handler itself returns a value.
actor Session {
let user: string;
var messages: Vec<string> = Vec.new();
receive fn post(text: string) {
messages.push(text);
}
receive fn count() -> i64 {
messages.len()
}
}
fn main() {
let chat = spawn Session { user: "ada", messages: [] };
chat.post("hello").expect("actor stopped");
chat.post("world").expect("actor stopped");
let total = chat.count();
match total {
.Ok(n) => println(f"{n} messages posted"),
.Err(_) => println("session unavailable"),
}
}Install Hew
Choose your operating system and compiler version.
v0.11.0 Β· Release
$ curl -fsSL https://hew.sh/install | bash -s -- --version 0.11.0$ curl -fsSL https://hew.sh/install | bash -s -- --version 0.11.0> Invoke-WebRequest https://hew.sh/install.ps1 -OutFile install.ps1
.\install.ps1 -Version 0.11.0What the language makes explicit
Each of these is available in v0.11.0.
- Caller:
chat.post("hello"). Waits for the handlerβs result. - Mailbox:
post("hello"). - One handler turn:
messages.push(text). Private state:messages: ["hello"]. - Completion result β Caller.
A successful post updates Sessionβs private state before returning its result.
Actor Isolation
Every actor owns its state exclusively, and the compiler enforces local actor boundaries and Send checks.
Supervision Trees
Supervisor actors, restart budgets, and the core restart strategies are part of the language rather than a separate framework.
Structured Concurrency
A scope bounds child work and waits for it before returning; fork starts independent actor calls that can be joined later.
Wire Contracts
Wire types put schema, field tags, and compatibility checks into the language, alongside the actors that send them.
Engineering Journal
Hew 0.11: trace an actor failure and debug a program Inspect owned actor failure details, debug native programs and format machine guards faithfully in Hew 0.11. Nov 12, 2026Read the Blog β
Hew Notes
Language development, engineering articles, releases and community projects, about once a month, with an extra issue for a significant release. Written in English.
Subscribe to Hew Notes