Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

GC story for arrays? #151

@dcodeIO

Description

@dcodeIO

As briefly mentioned in #145, arrays have yet unaddressed overhead / interoperability problems:

  • A compiler (or its standard library) cannot efficiently pre-allocate or resize arrays, if the language's array type is resizable (like JS), for instance by pushing to it. Instead it has to grow the array by one element at a time where the element type is not defaultable, producing copying overhead and likely garbage collector pressure over something that is otherwise the ABC of compiler development.
  • Even if the element type is defaultable, resizing arrays in an efficient way implicitly makes the array non-interoperable between the module and either the host or another module because it contains placeholder elements over its actual length.

When remaining unaddressed, these limitations will effectively prevent AssemblyScript for example from adopting Wasm GC early, losing one potentially valuable source for informing the process. I hence suggest to evaluate solutions in the MVP.

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