Skip to main content

Hew

Hew compiles actor-based programs to native code. Each actor owns its state, and supervisors decide how failed actors restart.

Read current status Β· GitHub

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.

Read the actor model β†’
session.hew
// 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

Read the complete installation guide.

What the language makes explicit

Each of these is available in v0.11.0.

A call into Session
  1. Caller: chat.post("hello"). Waits for the handler’s result.
  2. Mailbox: post("hello").
  3. One handler turn: messages.push(text). Private state: messages: ["hello"].
  4. 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, 2026
Read 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