Skip to content

introduce wasm_runtime_instantiate_ex2#4444

Merged
lum1n0us merged 2 commits intobytecodealliance:mainfrom
yamt:wasm_runtime_instantiate_ex2
Jul 14, 2025
Merged

introduce wasm_runtime_instantiate_ex2#4444
lum1n0us merged 2 commits intobytecodealliance:mainfrom
yamt:wasm_runtime_instantiate_ex2

Conversation

@yamt
Copy link
Copy Markdown
Contributor

@yamt yamt commented Jul 2, 2025

at this point, just a slightly inefficiant functionality
equivalent of wasm_runtime_instantiate_ex.
however, unlike wasm_runtime_instantiate_ex, this one is designed
to be extendable without breaking the user-visible ABI.
because the definition of InstantiationArgs2 is not exposed to
users, we can safely add new members to it.

this commit also makes wasm_runtime_instantiate_ex a wrapper
of wasm_runtime_instantiate_ex2.

if this goes well, maybe it's a good idea to apply a similar
pattern to RuntimeInitArgs, LoadArgs, SharedHeapInitArgs, etc.
i started with InstantiationArgs just because i happen to have
a need to extend it for wasi-nn.

cf.
#4364
#4331

yamt added 2 commits July 2, 2025 14:53
at this point, just a slightly inefficiant functionality
equivalent of wasm_runtime_instantiate_ex.
however, unlike wasm_runtime_instantiate_ex, this one is designed
to be extendable without breaking the user-visible ABI.
because the definition of InstantiationArgs2 is not exposed to
users, we can safely add new members to it.

this commit also makes wasm_runtime_instantiate_ex a wrapper
of wasm_runtime_instantiate_ex2.

if this goes well, maybe it's a good idea to apply a similar
pattern to RuntimeInitArgs, LoadArgs, SharedHeapInitArgs, etc.
i started with InstantiationArgs just because i happen to have
a need to extend it for wasi-nn.

cf.
bytecodealliance#4364
bytecodealliance#4331
@yamt yamt force-pushed the wasm_runtime_instantiate_ex2 branch from 8f96cb1 to 392482c Compare July 2, 2025 05:53
Copy link
Copy Markdown
Contributor

@lum1n0us lum1n0us left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC, there should be some APIs related to WASI. OR are they included in another PR?

@yamt
Copy link
Copy Markdown
Contributor Author

yamt commented Jul 10, 2025

IIUC, there should be some APIs related to WASI. OR are they included in another PR?

i plan to add them later.

@yamt
Copy link
Copy Markdown
Contributor Author

yamt commented Jul 10, 2025

IIUC, there should be some APIs related to WASI. OR are they included in another PR?

i plan to add them later.

i meant another PR.

@lum1n0us lum1n0us merged commit 5d48cfd into bytecodealliance:main Jul 14, 2025
426 checks passed
@lum1n0us lum1n0us added breaking-change Determine if this PR introduces breaking changes. It will be used by scripts to classify PRs. new feature Determine if this Issue request a new feature or this PR introduces a new feature. and removed breaking-change Determine if this PR introduces breaking changes. It will be used by scripts to classify PRs. labels Jul 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new feature Determine if this Issue request a new feature or this PR introduces a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants