---
title: "Core Concepts"
description: "A welcoming guide to Hew ownership, affine resources, actor isolation, message transfer, lifecycle, supervision, and structured concurrency."
source: "https://hew.sh/docs/concepts"
---

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

These pages describe **v0.9.3**. The [released language guide](https://github.com/hew-lang/hew/blob/v0.9.3/docs/hew-language-guide.md) and [language specification](https://github.com/hew-lang/hew/blob/v0.9.3/docs/specs/HEW-SPEC-2026.md) are the semantic authority when a detail matters.

## Start with your question

[Values and resources

### Who owns this value?

Understand ordinary values, moves, cloning, deterministic cleanup, and what “affine” means in Hew.

](/docs/concepts/ownership)[Actors and messages

### What crosses an actor boundary?

See how actor isolation, `Send`, snapshots, affine transfers, and call outcomes work together.

](/docs/concepts/message-passing)[Long-lived work

### Who starts, stops, and restarts an actor?

Follow an actor from construction through handlers and cleanup, then add supervision for recovery.

](/docs/concepts/actor-lifecycle)[Concurrent work

### How long may a task run?

Use `scope`, `fork`, `await`, deadlines, and cancellation without losing track of child work.

](/docs/concepts/structured-concurrency)

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

-   **Learn by building:** use the [actor-based key-value store tutorial](/docs/tutorial) or the [interactive lessons](/learn).
-   **Understand the model:** read these concept pages, then the [actor guide](/docs/actors), [authority confinement guide](/docs/confinement), or [state-machine guide](/docs/machines) for the part you are designing.
-   **Check exact syntax and contracts:** use the [language reference](/docs/language-spec), [standard-library guide](/docs/stdlib), the [released language and API reference](https://docs.hew.sh/), and the specification linked above.

## Related ideas in other systems

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.

-   [The Rust Book: Understanding Ownership](https://doc.rust-lang.org/book/ch04-00-understanding-ownership.html) — an approachable introduction to ownership-based memory management. Hew has different borrowing and value rules.
-   [The Swift Programming Language: Concurrency](https://docs.swift.org/latest/documentation/the-swift-programming-language/concurrency) — a broader treatment of parent-child tasks and structured concurrency.
-   [Erlang/OTP supervision principles](https://www.erlang.org/doc/system/sup_princ.html) — the established model behind supervision trees and restart intensity.
-   [Pony reference capabilities](https://tutorial.ponylang.io/reference-capabilities/reference-capabilities.html) — an advanced comparison for compile-time actor isolation; Pony's capability system is not Hew's type system.
