Custom Effects

Define your own effects and propagate them through function signatures.

Custom Effects

Custom effects are part of the language story, but they sit closer to the boundary between currently demonstrable behavior and the richer handler model still under active design and implementation. This page documents that boundary directly.

What is safe to claim

  • Sounio has a dedicated effect subsystem in the active source tree.
  • The public contract should emphasize explicit effect declarations and propagation before it promises advanced handler ergonomics.
  • Custom effect examples are useful for explaining the model, but the deepest execution semantics should still be cross-checked against current implementation status.

Model-level custom effect sketch

effect Fail {
    fn fail(msg: string) -> !
}

fn main() with Fail {
    Fail.fail("demo")
}

Implementation surface

  • self-hosted/effects/types.sio is the right place to look for effect representations.
  • self-hosted/effects/handlers.sio and self-hosted/effects/checker.sio show how the self-hosted implementation is approaching handlers and checking.
  • self-hosted/check/effects.sio connects the language-facing checker work to the dedicated effect subsystem.

Documentation stance

  • Teach custom effects as part of the model.
  • Teach handler execution details conservatively and only with concrete implementation caveats.
  • If you need stronger claims, back them with a current fixture or with a targeted implementation audit.