Skip to content

v0.6.2

Choose a tag to compare

@github-actions github-actions released this 21 Oct 01:44
· 390 commits to main since this release
v0.6.2
dd09111

Hew v0.6.2

Hew 0.6.2 unifies actor references across local, supervised and authenticated
remote actors, completes checked collection dispatch, and fixes ownership and
execution failures found in real applications. It also adds checked TOML values,
shared semaphore handles and workspace publishing.

Upgrading from 0.6.1

Read the migration guide before rebuilding an
application. The 0.6 series continues to refine language and library interfaces.

  • Upgrade communicating nodes together. Wire protocol 8 carries authenticated
    actor services and separate terminal cleanup diagnostics; incompatible peers
    are refused. Diagnostics sent to authenticated observers may contain
    application-provided text and are bounded to 4096 UTF-8 bytes.
  • Use an actor's declared type for local, supervised and imported references.
    Replace ChildRef<A>, RemotePid<A> and net.Service<A> with A, and remove
    ActorMsg implementations. Obtain imported actors through authenticated grants.
  • Replace the removed string and sorting aliases with indexed Unicode scalar
    access, iterators and generic sorting, as listed in the migration guide.
  • Rebuild native libraries that exchange managed strings against this SDK.
    Their string layout changed; an older compiler/runtime pair is insufficient.
  • Migrate TOML resource handles and consuming builders to checked ordinary values
    with automatic cleanup. Mutations require var; copies keep independent values.
  • Launch the language server with hew lsp and the observer with hew observe.
    Both tools are included in the single hew executable.

Actors and lifecycle

An actor's declared type is its reference type across placement. Stable supervised
roles continue to resolve their current worker after restarts, while references
to a concrete worker keep that incarnation's identity. Both is and == compare
actor identity; a stable role remains distinct from its current worker.

Authenticated peers exchange revocable service grants. Receive handlers remain
ordinary actor calls, including mailbox admission, completion and lifecycle
observation. Definite rejection can return the unaccepted request for retry;
uncertain remote admission consumes it rather than risking duplicate delivery.

stopped(actor) waits for terminal cleanup without raising the actor's already
reported original crash again. Separate faults from stop hooks or cleanup remain
observable locally and remotely. Monitoring a vacant supervised role reports its
absence immediately; monitoring an occupied role follows the observed incarnation.
Nested supervisor restart waits follow replacements without losing role identity.

A receive gen fn executes against its actor's live state and retains an
exclusive producer turn through yields until completion, close or cancellation.
Closing a reader cancels the producer and completes cleanup before another
handler starts. A consumer that keeps the stream open while calling the same
actor waits behind that producer.

Lambda actors use actor capture(var total) or
actor move capture(var total) for mutable private captures. The enclosing
binding may be immutable; the actor changes its own independent value. Captures
without the prefix are read-only. Ordinary generators retain their admitted
mutable private captures.

Actor-owned one-shot timers, typed crash notifications, configurable supervisor
pools and suspended crash hooks compose with the same lifetime and stop-budget
rules. Observe exposes supervisor drill-down and runtime metrics.

Values, collections and libraries

Generic iteration, indexing and trait calls use checked declaration and effect
facts through lowering. Recursive records and enums containing vectors support
structural equality when their members do; eligible recursive records also work
as map keys and set elements. Indexed field updates avoid copying an entire
vector and preserve rollback if a callback fails.

Strings use Unicode scalar indices and ranges, with optional checked access and
snapshot iteration. Generic sorting, command-line argument parsing and typed HTTP
routing use ordinary Hew library code. Process output capture supports combined
byte limits, deadlines and cancellation.

std.encoding.toml.Value follows JSON's checked value model: typed kinds and
errors, independent copies, optional missing fields and automatic cleanup.
Wrong-kind access returns an error. Semaphore.clone() explicitly shares a
permit count while each handle retains its own affine lifetime; closing a handle
does not invalidate other handles or pending acquisitions.

std.machine.watch.observe wraps the ordinary machine evaluator with bounded
subscriptions, atomic state/revision snapshots and ordered transition notices.
Slow consumers receive explicit lag, and owner closure drains retained notices.
Machine event-head bindings are visible to both guards and transition bodies.
Fieldless outputs use emit Ready;; the formatter migrates empty keyed braces.

Quoted imports preserve module privacy and support aliases such as
import "codecs/huffman.hew" as huffman;. Imported constants, generic actors,
private helpers and range slices retain their declaration identities. Unsupported
f-string suffixes are diagnosed instead of silently dropping trailing input.

Tools and execution

Plain make builds and stages the native compiler and support artefacts.
hew run forwards signals, reaps its owned children and preserves foreground
input, including WASI execution.

hew publish --workspace validates and publishes workspace packages in dependency
order through one prepared plan. Dependency inputs are checked against the packed
archives, member paths are contained, and interrupted publication reports partial
progress. This also fixes publishing packages that import installed dependencies.
Native archive upload remains a separate workflow; it is not implied by workspace
source publication.

The compiler supports signed native package installation and experimental typed
C host owners. Rebuild generated headers, objects and the runtime together.
Browser and WASI execution gain task, select and periodic-handler support within
the documented capability matrix. Native SDKs target Linux, macOS, Windows and
FreeBSD; platform and release qualification remain required before publication.