Issue #1503: Does “automatic only where needed” (from the shared-handle rule) extend to other areas of the language?

Open and answer this issue on GitHub.

spec, decision · opened 2026-11-09 · updated 2026-11-22 · 0 comments

Question from the owner, 2026-11-09: #1502 introduces a new rule. The cost of an automatic operation depends not on the type alone but on whether it is really needed, which here means whether the value is used again afterwards. Does this principle fit Nikaia’s philosophy? Should it be extended to other areas, or stay at this one place for now?

Starting point

To examine (decision paper)

  1. State the principle precisely. An automatic operation is allowed when (a) its cost is constant and small (no data copied), (b) it happens only where needed (a later use), and (c) a tool shows every site. Are these the right conditions, and which language principle (docs/supervisor.md, Language decisions) carries them?
  2. Candidate areas. For each: what it would change, what the cost is, and probes from real code (toolchain, packages) with counts per I8a.
    • A refused move of data that is used again (NK2105 “hand over a copy”): data, so cost by size. Presumably stays refused. Say why.
    • Views and Owned promotion (ADR-283 D3).
    • Map reads m[k]?.clone() (NK1102).
    • Rc-like values in packages, and handles of other kinds (files, channels, tasks).
    • with (ADR-118 D3).
  3. Recommendation: extend (which areas, with ADRs), or keep the rule local to shared handles, with reasons. Include the effect on the “no hidden costs” promise and on how it is communicated.

Done when

A decision paper with options, probes and a recommendation is in this issue, and the owner has decided. A decision to extend is filed as its own ready issues.

Part of the follow-up to #1502.


Generated by Claude Code

Back to Open Issues