Skip to main content

Core Concepts

Build a useful mental model first; follow the details when your program needs them.

Hew programs are made from familiar values and functions, plus actors that own long-lived state. A few terms describe how those pieces fit together. You do not need to learn the vocabulary before writing Hew: start with the question your program raises, then follow the relevant concept.

Start with your question

The model in one pass

  1. Values have owners. Ordinary data can provide an independent logical value when reused. An affine value has one live owner and transfers instead.
  2. Actors own mutable state. One handler at a time can reach an actor's state, so callers interact through typed messages rather than shared mutation.
  3. Actor boundaries preserve isolation. Ordinary message data arrives as a snapshot. A sendable affine resource moves to the receiver. The compiler derives and checks Send.
  4. Tasks belong to a lifetime. fork starts child work, await takes its result, and the owning scope settles every child before it exits.
  5. Actors have independent lifetimes. Calling an actor does not make it a child task. Use stop, stopped, and supervisors to manage actor lifetime and recovery.

A small glossary

Actor
An independently scheduled component that owns state and handles one message at a time.
Actor handle
A typed value used to call an actor. It names the actor; it does not expose the actor's fields.
Ownership
The rules that decide who is responsible for a value and when its cleanup runs.
Affine value
A value with at most one live owner. It may be moved or consumed, but it cannot be duplicated without a type-specific clone contract.
Send
A compiler-derived marker saying a type can safely cross an actor boundary. It says the crossing is safe, not whether the runtime copies, retains, or moves storage.
Snapshot
The independent logical value an actor receives for ordinary message data. Later mutation by one actor cannot change the other's value.
Task
A concurrent computation created by fork and owned by a structured lifetime.
Scope
A boundary that settles its child tasks and cleanup before producing its value.
Supervisor
An owner of child actor roles that applies restart policies and limits repeated failure.
Authority
The ability to perform an operation, such as reading a particular file. Hew can make that access explicit by supplying a narrow service or resource.

Choose the depth you need

These resources explain broader ideas that influenced the field. Their syntax and rules are specific to their own languages; use the Hew pages above for Hew semantics.