Skip to content

Instantly share code, notes, and snippets.

@daxhuiberts
Last active April 16, 2024 17:56
Show Gist options
  • Save daxhuiberts/5ebc879ed89ba58967a4215253153a0a to your computer and use it in GitHub Desktop.
Save daxhuiberts/5ebc879ed89ba58967a4215253153a0a to your computer and use it in GitHub Desktop.
Most basic WASI v0.2 CLI component
(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