Skip to content

Core WebAssembly Reference Types (externref) Support in Swift Compiler#1

Draft
ayushshrivastv wants to merge 6 commits into
mainfrom
core-webassembly-support-in-swift-compiler
Draft

Core WebAssembly Reference Types (externref) Support in Swift Compiler#1
ayushshrivastv wants to merge 6 commits into
mainfrom
core-webassembly-support-in-swift-compiler

Conversation

@ayushshrivastv

@ayushshrivastv ayushshrivastv commented Mar 30, 2026

Copy link
Copy Markdown
Owner

This draft pull request adds Core WebAssembly Reference Types (externref) Support in Swift Compiler.

Core WebAssembly provides primitive scalar and vector types such as i32, i64, f32, f64, and v128, but higher-level types with reference semantics are typically handled via a host-managed table that maps integer indices to stored references.

This pull request introduces an experimental WasmExternref feature in the Swift standard library, including correct lowering of operations to the appropriate LLVM IR address space and type-checker semantics aligned with Clang’s __externref_t.

As stretch goals, it also proposes exposing WebAssembly externref table builtins similar to Clang’s __builtin_wasm_table_ functions and adding a WasmExternrefIndex type to wrap externref table indices for use in Swift’s common values address space.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant