Skip to content

Should this proposal instead follow proposed Immutable ArrayBuffer pattern? #10

@erights

Description

@erights

The current state of this proposal would have .snapshot() of a mutable collection make an immutable copy. Without special implementation tricks(*), this would be expensive.

By contrast, https://github.com/tc39/proposal-immutable-arraybuffer has a zero-copy .toImmutable(), that "detaches" the data from the original collection, so the creation of the derived immutable collection is zero-copy without special implementation tricks.

(*) such as copy-on-write. At least for ArrayBuffers (including proposed Immutable ArrayBuffers) some implementations have expressed strong reluctance to implement such tricks. However, we don't yet know whether this reluctance would apply to other collections.

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