Skip to content

Define WebAssembly target and ABI contracts #366

Closed

Description

@LunaStev

Tracked by #349.

Problem

Before enabling WebAssembly code generation, Wave needs explicit target contracts that distinguish freestanding WebAssembly, WASI, and browser/JavaScript environments.

Decisions required

  • Canonical target triples and aliases.
  • 32-bit versus future 64-bit linear-memory pointer model.
  • Default CPU/features and proposal policy.
  • Object/module output kind and linker responsibility.
  • Function ABI, aggregate lowering, and import/export naming.
  • Freestanding entry behavior versus WASI command/reactor behavior.
  • Unsupported combinations and pre-codegen diagnostics.
  • wavec print target-spec --format=json fields.

Deliverables

  • A repository target-contract document.
  • Machine-readable target registry expectations.
  • Positive and negative target option tests.
  • A staged implementation plan that does not claim execution support before runtime smoke tests exist.

Completion criteria

  • Freestanding, WASI, and browser contracts are separately defined.
  • Pointer and memory assumptions are explicit.
  • Import/export ABI behavior is explicit.
  • Unsupported features fail before backend invocation.
  • The contract is usable by LLVM and future Whale tooling.

Activity

  1. added
    enhancement
    help wanted
    discussion
    on Aug 25, 2026
  2. Swarnabha753 commented on Aug 27, 2026

    @Swarnabha753

    Hi @LunaStev, I’d like to work on this issue.

    I can take the target/ABI contract work first, including defining the freestanding, WASI, and browser target distinctions, documenting the pointer/memory and import/export ABI assumptions, and adding the corresponding positive/negative target-option tests.

    If that sounds good, I’d be happy to take #366.

  3. LunaStev commented on Aug 27, 2026

    @LunaStev
    MemberAuthor

    Hi @LunaStev, I’d like to work on this issue.

    I can take the target/ABI contract work first, including defining the freestanding, WASI, and browser target distinctions, documenting the pointer/memory and import/export ABI assumptions, and adding the corresponding positive/negative target-option tests.

    If that sounds good, I’d be happy to take #366.

    Thanks! I've assigned this issue to you.

  4. Swarnabha753 commented on Aug 28, 2026

    @Swarnabha753

    Hi @LunaStev, thanks for assigning #366 to me. After looking through the existing Rust/LLVM target implementation, I realized this issue is outside my current experience, particularly the Rust, LLVM, and WebAssembly ABI work.

    I don't want to submit a speculative implementation that may not fit the project, so I think it's better for me to step back from this issue and let someone with more relevant compiler/LLVM experience take it forward.

    Sorry for the change of plans, and thank you for understanding.

  5. LunaStev commented on Aug 28, 2026

    @LunaStev
    MemberAuthor

    Hi @LunaStev, thanks for assigning #366 to me. After looking through the existing Rust/LLVM target implementation, I realized this issue is outside my current experience, particularly the Rust, LLVM, and WebAssembly ABI work.

    I don't want to submit a speculative implementation that may not fit the project, so I think it's better for me to step back from this issue and let someone with more relevant compiler/LLVM experience take it forward.

    Sorry for the change of plans, and thank you for understanding.

    That's fine. Thank you for taking the initiative. If you ever get into LLVM and Rust or self-hosting, please learn Wave and contribute, or build lots of things with Wave. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionenhancementhelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions