-
Notifications
You must be signed in to change notification settings - Fork 3
Example on creating a proper wasm file #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Yeah, when you compile webassembly you need to disable the abort import using This is the command line I used:
Actually, support for imports was recently merged into |
That's great! thanks a lot. I saw it was merged :-) I would like to install [edit] |
I still get an error when I specify koen$ cat /tmp/main.ts
export function helloworld(s: string): string {
return "foo:" + s
} koen$ npx assemblyscript /tmp/main.ts -b --use abort= > /tmp/output.wasm
npx: installed 3 in 4.285s
ERROR: AssertionError: assertion failed
at t.assert (/Users/koen/.npm/_npx/27619/lib/node_modules/assemblyscript/dist/assemblyscript.js:7:576726)
at g.initialize (/Users/koen/.npm/_npx/27619/lib/node_modules/assemblyscript/dist/assemblyscript.js:7:44520)
at Object.t.initializeProgram (/Users/koen/.npm/_npx/27619/lib/node_modules/assemblyscript/dist/assemblyscript.js:7:594197)
at stats.compileTime.measure (/Users/koen/.npm/_npx/27619/lib/node_modules/assemblyscript/cli/asc.js:595:22)
at measure (/Users/koen/.npm/_npx/27619/lib/node_modules/assemblyscript/cli/asc.js:1103:3)
at Object.main (/Users/koen/.npm/_npx/27619/lib/node_modules/assemblyscript/cli/asc.js:594:26)
at asc.ready.then (/Users/koen/.npm/_npx/27619/lib/node_modules/assemblyscript/bin/asc:21:47)
at process.runNextTicks [as _tickCallback] (internal/process/task_queues.js:52:5)
at Function.Module.runMain (internal/modules/cjs/loader.js:880:11)
at findNodeScript.then.existing (/Users/koen/.nvm/versions/node/v11.15.0/lib/node_modules/npm/node_modules/libnpx/index.js:268:14) koen$ npx assemblyscript -v
Version 0.9.4 |
Hm - I think you have to open a ticket with AssemblyScript here, seems like a bug on their side. I've run into assertion errors myself, though this seems like to easy a function to cause them. Note that overriding the abort function is documented and should be officially supported. |
You are right. Found the issue on their side: This works: koen$ npx [email protected] /tmp/main.ts -b --use abort= > /tmp/output.wasm |
Hi,
Thanks for this really interesting library. This is a great step for writing code that can run in the browser and in a python backend!
I was wondering if you can share an example of how to compile WebAssembly so it's loadable by python-ext-wasm. I know this issue might be unrelated to this library.
I tried this:
assemblyscript
npm packagenpx asinit sometest
npm run-script asbuild
When I try to load the file I keep getting:
It looks like it's related to "Support imports (needs #28)" but I'm confused by your example which doesn't do anything with imports.
Could you share a some info on how to create a proper .wasm file?
Thanks a lot!
The text was updated successfully, but these errors were encountered: