Skip to content

Decide and enforce Flow 1.0 default behaviour for unhandled effects #563

Closed

Description

@godofecht

Tracking issue for the remaining effect-row/default-handling gap recorded in docs/effects-showcase.md.

Current state

--strict-effects enables compile-time effect coverage checking for lexical handlers, declared function rows, and first-class function types carrying effect rows. The latter is now covered by tests/unit/test_effect_rows.py; the old claim that function-type rows were still open is obsolete.

Strict type checking also validates effect-operation names, arity, argument types and return types for Effect.operation(...) calls.

The remaining 1.0 problem is the default coverage/failure policy.

Without --strict-effects, an unhandled operation still uses the soft runtime path. FLOW_STRICT_EFFECTS=1 can make that runtime path abort, while --strict-effects additionally enables compile-time coverage checking and hardcodes the abort path in generated C. With neither enabled, a missing handler may return a zero value silently.

1.0 decision

For the Stable 1.0 effect system, silently losing an effect should not be the normal default. The target policy tracked by #643 is:

  • normal Stable compilation performs effect-row coverage checking;
  • an unhandled Stable effect is a compile-time error where coverage is statically knowable;
  • any remaining runtime-unhandled path fails loudly rather than returning a silent zero value;
  • a deliberately permissive/legacy mode may remain available only as an explicit opt-in;
  • handler nesting, propagation and the tail-resumptive continuation boundary remain specified and tested.

Acceptance

  • Normal Stable compilation enables effect-row coverage checking without requiring --strict-effects.
  • Missing handlers do not silently produce zero values in normal Stable mode.
  • A deliberately permissive compatibility mode, if retained, is explicit rather than the default.
  • Declared function effect rows are enforced.
  • First-class function types carrying effect rows are parsed and enforced.
  • CLI/docs/tests agree on the default policy.
  • Stable effect examples pass under the canonical flowc path.

Related

Activity

  1. changed the title [-]Effect rows are only enforced under --strict-effects; function types with rows still open[/-] [+]Decide and enforce Flow 1.0 default behaviour for unhandled effects[/+] on Aug 21, 2026
  2. added
    effects
    1.0-stabilisation
    rc1-blocker
    P0-blocker
    on Aug 21, 2026
  3. godofecht commented on Oct 1, 2026

    @godofecht
    ContributorAuthor

    Reference implementation against the retired Python compiler: tag archive/feat/563-effects-default (6f693d2). Useful as a design starting point for the Flow implementation.

  4. godofecht commented on Oct 2, 2026

    @godofecht
    ContributorAuthor

    Resolved in PR #1182. Stable effect coverage and fail-loud runtime handling were already implemented; this change aligns the CLI help, language reference, examples, and goldens with that default. Legacy zero/no-op behavior is explicit through FLOWC_PERMISSIVE_EFFECTS=1 and FLOW_PERMISSIVE_EFFECTS=1. Hosted CI passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    1.0-stabilisationP0-blockercompilereffectsrc1-blocker

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions