Skip to content

Introduce slots; remove mutable boxes/vectors/record fields/object fields #856

Closed
@pcwalton

Description

@pcwalton

IIRC we agreed upon the notion of a "slot", which is a simple way to create a mutable interior value. This lets us abstract over the mutable and immutable vectors without the subtyping relation that "mutable?" introduces, which is painful (and which we never got right in the presence of generics).

So you could construct a slot using, say, slot 3, and that creates a mutable pseudo-box that is interior. Slots have no representation at the IR level; they're purely a way to help us enforce immutability restrictions. [mutable int] would become [slot int], @mutable int would become @slot int, etc.

This may be appropriate for the first milestone, depending on how serious we consider the type soundness hole with generics to be for 0.1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions