Use with wasi-shim?
See original GitHub issueI see you’ve updated to use wasi-shim
, but it’s not clear how usage/configuration has changed.
- No more need to
import "wasi"
, right? - How do I correctly configure my
asconfig.json
?
Adding nothing results in a module that won’t execute:
Error: failed to run main module `build/debug.wasm`
Caused by:
0: failed to instantiate "build/debug.wasm"
1: unknown import: `env::abort` has not been defined
Following the instructions from wasi-shim
results in a module that won’t compile.
ERROR TS2300: Duplicate identifier 'wasi_abort'.
:
1100 │ export function wasi_abort(
│ ~~~~~~~~~~
└─ in ~lib/as-wasi/assembly/as-wasi.ts(1100,17)
:
19 │ export function wasi_abort(
│ ~~~~~~~~~~
└─ in ~lib/wasi_internal.ts(19,17)
Issue Analytics
- State:
- Created a year ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
WASI shim for AssemblyScript - GitHub
The AssemblyScript compiler now emits WASI-compatible modules. No more Web APIs! Migrating from 0.20. Using this shim offers almost identical ...
Read more >Wasm3 (@wasm3_engine) / Twitter
And apparently it uses AssemblyScript + wasi-shim in a refreshing act of boldness, ... Plus: Why use a standalone WebAssembly engine in the...
Read more >Generic loader script for C wasm : r/WebAssembly - Reddit
My work involves importing and using wasm in web applications. ... else" to compile to WASI instead of emscripten, and use the JS...
Read more >As-wasi NPM | npm.io
Here are some exported classes that are commonly used: FileSystem - Reading and Writing the user's fileystem.; Console - General logging to stdout...
Read more >10 Fun Facts About Grand Forks, ND
Ishim: Grand Fork's first sister city was Ishim, Tyumen Oblast, Russia. The relationship with Ishim began during the Cold War in 1984, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I guess ideally, both wasi-shim and as-wasi are used alongside, where wasi-shim reconfigures stdlib to use WASI APIs while as-wasi provides additional APIs that are not present in stdlib. Seems this could work well as the default, given that:
Console.*
(wasi-shim implements stdconsole.*
)Time.*
(wasi-shim implements stdDate.*
andperformance.*
)Environ.*
(wasi-shim implements node-likeprocess.*
)--use
directives in as-wasi itselfwasi-shim only overrides APIs already in AS’s stdlib, that is standard-ish JS or, where useful, Node APIs. A
console.readAll
with no equivalent in JS/Node should remain in as-wasi, unless it can be refactored to map to an actual JS/Node API that is first added to AS stdlib, and then overridden by wasi-shim.