Skip to content

fix: Handle Wasm ValueTypes returned by imports#141

Draft
blaine-arcjet wants to merge 12 commits intomainfrom
phated/host-import-return-value
Draft

fix: Handle Wasm ValueTypes returned by imports#141
blaine-arcjet wants to merge 12 commits intomainfrom
phated/host-import-return-value

Conversation

@blaine-arcjet
Copy link
Contributor

@blaine-arcjet blaine-arcjet commented Dec 18, 2025

This reworks Wasm imports to build functions with explicit Wasm ValueTypes based on the Wasm signature provided by the WIT tooling. This requires that we use the stack provided by Wazero but that makes using the various api.Decode* and api.Encode* functions work correctly on Wasm imports.

I believe this resolves some issues introduced by my changes in #96

@blaine-arcjet blaine-arcjet force-pushed the phated/host-import-return-value branch from 6ab6e43 to 1d1a789 Compare December 19, 2025 18:29
@blaine-arcjet blaine-arcjet force-pushed the phated/host-import-return-value branch from 5b3a384 to 4c7e1ce Compare January 2, 2026 21:23
@blaine-arcjet blaine-arcjet marked this pull request as ready for review January 2, 2026 21:27
@blaine-arcjet blaine-arcjet requested a review from a team as a code owner January 2, 2026 21:27
@blaine-arcjet blaine-arcjet changed the title fix: Return WasmI32 types from imported functions fix: Handle WasmI32-encoded ValueTypes returned by imports Jan 2, 2026
@blaine-arcjet blaine-arcjet changed the title fix: Handle WasmI32-encoded ValueTypes returned by imports fix: Handle Wasm ValueTypes returned by imports Jan 2, 2026
@blaine-arcjet blaine-arcjet force-pushed the phated/host-import-return-value branch from 4c7e1ce to 538bb51 Compare January 5, 2026 16:04
@blaine-arcjet blaine-arcjet marked this pull request as draft January 5, 2026 16:20
@blaine-arcjet
Copy link
Contributor Author

This caused some other problems in codegen so I'm drafting it.

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.

2 participants

Comments