---
title: "Hew — A compiled language for programming with actors"
description: "Hew compiles actor-based programs to native code. Each actor owns its state, and supervisors decide how failed actors restart."
source: "https://hew.sh/"
---

# Hew

A compiled language for programming with actors

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

[Try Hew](/try/actors/) [Install Hew](/docs/getting-started/)

[Read current status](/status/) · [GitHub](https://github.com/hew-lang/hew)

## 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`.

After two posts, `count` returns the number of messages. The caller prints that number on success, or `session unavailable` if the call fails.

[Read the actor model →](/docs/actors)

session.hew

```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 to see the install command.

v0.11.3 · Release

[Read the complete installation guide.](/docs/getting-started/)

Shell

```bash
$ curl -fsSL https://hew.sh/install | bash -s -- --version 0.11.3
```

Shell

```bash
$ curl -fsSL https://hew.sh/install | bash -s -- --version 0.11.3
```

PowerShell

```powershell
> Invoke-WebRequest https://hew.sh/install.ps1 -OutFile install.ps1
.\install.ps1 -Version 0.11.3
```

## What the language makes explicit

Each of these is available in v0.11.3.

A call into Session

A successful post updates Session’s private state before returning its result.

### Actor Isolation

Only an actor can modify its own fields. The compiler checks which values callers can send to it.

### Supervision Trees

A supervisor declares which children to restart after a failure and how many restarts to allow in a given interval.

### Structured Concurrency

Use fork to start independent actor calls. Their enclosing scope waits for the child work before it returns.

### Wire Contracts

Numeric tags identify fields in a wire type. The compatibility checker compares revisions of the schema.

[Current status and roadmap →](/status/) [See how Hew compares to Go and Rust →](/docs/comparison)

## Engineering Journal

[Hew 0.11.3 lets servers finish accepted requests Set a deadline for graceful shutdown, finish HTTP requests in flight, and reclaim short-lived actors when their work ends. Dec 2, 2026  
Read the Blog →](/blog/2026/12/release-v0113)

## 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](/updates#hew-updates)

[Read past issues →](/updates) [Engineering journal RSS](/rss.xml) [Hew Notes RSS](/updates/rss.xml)
