Skip to content

Spec: Ownership and borrowing draft #2

@JROChub

Description

@JROChub

Context

  • The vision calls for safe, high-performance systems programming, but the spec lacks ownership/borrowing rules.

Goal

  • Draft a clear ownership and borrowing model in the spec so contributors can reason about memory safety.

Proposal

  • Add a new section in SPEC.md (or a focused appendix) that defines:
    • Ownership, moves, and copies.
    • Borrowing rules (mutable vs immutable).
    • Aliasing guarantees and lifetime model.
    • Diagnostics expectations for common mistakes.
  • Include 3-5 code examples showing valid/invalid patterns.

Acceptance criteria

  • Spec section exists with terminology and core rules.
  • Examples compile as Roc snippets (even if not yet implemented).
  • Open questions are called out explicitly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: specLanguage specificationdocumentationImprovements or additions to documentationhelp wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions