On this page

0103: Lifted parallel blocks and their capture rules

Status: Proposed (default; pending owner confirmation)

Extends ADR-0042 and ADR-0095: Par blocks are lifted rather than lowered inline, while other blocks retain their existing lowering.

Context

Parallel blocks need callable worker bodies without exposing scheduling through mutable captures or effectful capabilities.

Decision

Lift each parallel block to a synthetic function with captures passed as snapshots, evaluated after the receiver and arguments. Reject assignments to captured var values with E0721. Reject captured or returned types containing capabilities other than Fs, and Fs.open/File use in v0, with E0722. Captured Fs is dynamically read-only in workers: writes return the same error as read_only() in both backends.

Captured and input values are shared for uniqueness analysis, preventing in-place reuse; worker map access is read-only. Block arity and result diagnostics reuse the existing block codes.

Consequences

Workers cannot expose scheduling through supported effects or mutate shared inputs. Lifting and capture checks must behave consistently in both backends.