Last active
April 16, 2024 17:56
-
-
Save daxhuiberts/5ebc879ed89ba58967a4215253153a0a to your computer and use it in GitHub Desktop.
Most basic WASI v0.2 CLI component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(component | |
(core module $app | |
(func (export "run") (result i32) | |
i32.const 0 | |
) | |
) | |
(core instance $app (instantiate $app)) | |
(func $run (result (result)) (canon lift (core func $app "run"))) | |
(component $wrapper | |
(import "imported-run" (func $run (result (result)))) | |
(export "run" (func $run)) | |
) | |
(instance (export "wasi:cli/run@0.2.0") (instantiate $wrapper | |
(with "imported-run" (func $run)) | |
)) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment