Examples
Runnable Strata examples live under examples/.
Read them in this order:
hello.strfor the minimum source-to-runtime program.actor_ping.strfor spawning, sending, and a single worker transition.actor_sequence.strfor multiple messages and message-keyed transitions.actor_match.strfor whole-body match authoring that checks into typed message-keyed transitions.init_match.strfor whole-body match authoring ininit.init_return_match.strfor pure init return-match expressions.function_match.strfor module functions, process-local functions, and pattern matching outside actor dispatch.function_payload_match.strfor payload-bearing enum construction and matching in normal source functions.function_if_else.strfor pure value-level conditionals selected before lowering. See alsofunction_local_bindings.strfor sequential immutable source-local computation in normal source functions.function_collection_match.strfor immutable list/map source values and collection patterns in normal source functions.function_return_match.strfor function return-match expressions.process_return_match.strfor process step return-match expressions with uniform effect prefixes.process_return_match_arm_prefix.strfor selected step return-match arm action prefixes.process_return_match_arm_runtime_if_prefix.strfor selected step return-match arm-local runtime branch prefixes.process_return_match_arm_for_prefix.strfor selected step return-match arm-local bounded runtime loop prefixes.process_return_match_arm_for_if_prefix.strfor selected step return-match arm-local bounded runtime loop prefixes with loop-body runtime branch actions.process_return_match_arm_if_for_prefix.strfor selected step return-match arm-local runtime branch prefixes with bounded runtime loop branch actions.process_return_match_arm_action_block.strfor selected step return-match arms using ordinary action-block sequencing with multiple runtime branches and bounded loops.function_record_pattern.strfor source function record destructuring patterns.function_record_return_match.strfor function return-match record destructuring.function_record_body_match.strfor whole-body function match record destructuring.state_payload_enum.strfor payload-bearing process state enum transitions.collection_state.strfor immutable collection state and payload-dependent collection next-state templates.state_payload_match.strfor matching immutable current process state payloads.actor_instances.strfor multiple runtime instances of one process definition.actor_payloads.strfor typed message payloads and immutable payload bindings in actor step parameter patterns.runtime_if_else.strfor Mantle-backed runtime branching over a message payload.runtime_scalar_priority.strfor typed scalar payload computation, runtime-bound value conditionals, and Mantle-backed scalar branch selection.source_contract_data_primitives.strfor immutableStringandBytesdata in records, messages, functions, collections, exact equality, and Mantle typed primitive runtime values.runtime_payload_projection_if.strfor Mantle-backed runtime branching over a projected field from an immutable received record payload.runtime_payload_projection_next_state.strfor Mantle-backed runtime next-state branching over a projected field from an immutable received record payload.runtime_state_payload_projection_if.strfor Mantle-backed runtime branching over a projected field from an immutable current-state record payload.runtime_state_payload_projection_next_state.strfor Mantle-backed runtime next-state branching over a projected field from an immutable current-state record payload.runtime_nested_if_actions.strfor one bounded layer of nested statement-level runtime branch actions.runtime_final_if_guarded_loop.strfor bounded loop action prefixes inside final-position runtime branches.runtime_final_if_nested_if_actions.strfor one direct nested statement-level runtime branch action inside final-position runtime branches.runtime_final_if_nested_terminal_if.strfor one direct nested terminal final-position runtime branch inside final-position runtime branches.runtime_guard_noop.strfor omittedelseand explicit no-op runtime branch behavior.runtime_for_each.strfor Mantle-backed bounded runtime iteration over a typed list payload.runtime_for_each_empty.strfor the zero-iteration runtime collection case.runtime_for_each_if.strfor Mantle-backed runtime branch selection inside bounded loop bodies.runtime_for_each_nested_if_actions.strfor one bounded nested runtime branch inside a bounded loop-body branch.runtime_guarded_for_each.strfor guarding a whole bounded runtime loop.runtime_guarded_ref_loop.strfor routing a guarded bounded loop through a received direct process reference.runtime_guarded_ref_loop_jobs.strfor routing ordinary immutableJobvalues through a guarded loop and received direct process reference.runtime_loop_element_projection.strfor projecting immutable record fields from guarded runtime loop elements.actor_payload_match.strfor the same payload binding through a whole-bodymatch msg.actor_payload_split_match.strfor payload-sensitive same-message splitting inside a whole-bodymatch msg.actor_payload_split_signature.strfor payload-sensitive same-message splitting across step parameter patterns.actor_payload_split_signature_wildcard.strfor payload-sensitive step-signature wildcard fallback over discovered concrete payload cases.actor_payload_state_match_split.strfor payload-sensitive same-message splitting across state-match step clauses.actor_payload_state_match_wildcard.strfor payload-sensitive state-match wildcard fallback over discovered concrete payload cases.nested_patterns.strfor nested immutable constructor, record, list, and map payload destructuring.actor_reply.strfor transporting typed process references through message payloads.process_ref_stale_lifecycle.strfor a transported old runtime PID returningErr(Stopped(message))without retargeting to a newer worker.actor_emit_spawn_send.strfor one transition with declared emit, spawn, and send authority.imports_main.str, withimports_types.strandimports_worker.str, for source-unit imports checked and lowered from one root source path.boundary_contracts_main.str, withboundary_contracts_worker.str, for typed protocol, port, and component boundary contracts.component_composition_main.str, withcomponent_composition_worker.str, for checked local component-instance and port-binding composition admission.effect_outcomes.strfor immutable typed local send/spawn outcomes, commit-or-return state evidence, and the typed send-error contract shape.effect_outcome_mailbox_full.strfor a source-visibleFullsend outcome.effect_outcome_stopped_target.strfor a source-visibleStoppedsend outcome after a normally terminated target.effect_outcome_crashed_target.strfor the fail-closed boundary where a source-createdPanic(...)prevents a later observer from recovering the crash as a source-visible send outcome.effect_outcome_spawn_denied.strfor source-visible local spawn authority denial before process acceptance.effect_outcome_spawn_exhausted.strfor source-visible local spawn capacity exhaustion before process acceptance under--max-runtime-processes 1.effect_outcome_spawn_backend_unavailable.strfor source-visible local spawn backend unavailability before process acceptance under--disable-local-spawn-backend.actor_panic_no_replay.strfor fail-closed actor failure and no replay after message dequeue.local_supervision_restart.str,local_supervision_permanent_stop.str,local_supervision_temporary.str,local_supervision_transient_restart.str,local_supervision_transient.str, andlocal_supervision_inactive_send_outcome.strfor localone_for_onesupervision, lexical child sends, restart modes, stopped-child send outcomes, and restart observability.local_supervision_inactive_crashed_send_outcome.strfor source-visibleErr(Crashed(message))when an inactive temporary supervised child failed before the send was accepted.
Detailed notes are grouped by topic: