Questions tagged [webassembly]
WebAssembly (abbreviated Wasm) is a new portable, size- and load-time-efficient format suitable for compilation to the web.
webassembly
1,187
questions with no upvoted or accepted answers
11
votes
3
answers
2k
views
What's a better way to deal with closures in WebAssembly with Rust instead of using forget and leaking memory?
When providing callbacks to JavaScript using Closures, what's a better way to deal with avoiding freeing them? The wasm-bindgen guide suggests using .forget, but admits that that is essentially ...
11
votes
0
answers
918
views
Reduce footprint of .NET compiled to Wasm
I am using Mono to compile C# to Wasm in order to use it in the browser. Running the following commands procuces a bunch of DLLs, a wasm file, and some JS files.
csc /target:library -out:regex101....
10
votes
1
answer
908
views
How do I include a wasm file compiled by golang in a chrome extension?
I've tried everything in here:
Golang to wasm compilation
And I can't get past:
WebAssembly.instantiate(buffer, {wasi_snapshot_preview1: ""})
WebAssembly.instantiate(buffer, {go: {debug: &...
10
votes
0
answers
563
views
Generate DWARF debug info in wasm binary from go?
I'm trying to generate a wasm binary with DWARF debugging info via (non-Tiny) Go. Despite many iterations with the build, gimli/dwarfdump keeps showing empty debug data sections (though it shows non-...
10
votes
0
answers
438
views
Alternative to ctor/inventory for when compiling to wasm?
The ctor crate doesn't support web assembly currently, although there is active discussion about how to fix this.
Although I am well aware of the issues associated with static initialization coming ...
10
votes
1
answer
2k
views
Importing and compiling a module with wasm into webpack
I'm trying to import a module for use within a library which is compiled through webpack. Although the javascript API from the module is loaded, the accompanying .wasm file is not and causes any ...
10
votes
0
answers
1k
views
Rollup: bundling/embedding wasm code from an external module
Using rollup, I'm trying to bundle a typescript library that imports and calls an npm module that contains a wasm file.
Only the resulting bundle contains no trace of the wasm file contents. How can ...
10
votes
0
answers
5k
views
Keep WKWebView page active in the background
I have a toy iOS app that's just for me. It's a native wrapper of a web-based WebAssembly-heavy game.
It's one of those where you set a task, and then wait for it to complete. Great for desktop ...
10
votes
2
answers
4k
views
How can I get `cmake` work in JetBrains CLion to compile Emscripten/WebAssembly?
I am trying to properly setup JetBrains CLion 2019.1 to build WebAssembly from C source code.
I've tried almost everything, however, nothing works. I do not get any WebAssembly build. All I get is:
...
9
votes
0
answers
1k
views
Debugging WebAssembly in Chrome
I'm a relative newbie to WebAssembly, but I've been working with it and Emscripten for about a month now, and have a decent familiarity with the minimal build kits.
When it comes to debugging, I am ...
8
votes
0
answers
620
views
Why is passing DOM objects as `exnternref`s *slower* than passing through the JS value table?
I made a benchmark to measure how fast it is to call DOM APIs by passing DOM objects as exnternrefs to a Wasm function. This is the function to measure (written in Rust and compiled by rustc 1.55.0):
#...
8
votes
0
answers
4k
views
How to use Webassembly/wasm modules with Vite and Vue 3?
I am trying to import a wasm module into a vite vue 3 project.
https://github.com/rsms/markdown-wasm
<script>
import init, { parse } from "markdown-wasm";
export default {
async ...
8
votes
0
answers
1k
views
How to make coroutines in Wasm?
I'm trying to allow users to call "main" in C and have "main" wait for wait for a requestAnimationFrame to continue execution. I.e. main could have a while(1) loop, and in main, ...
8
votes
0
answers
2k
views
Python in browser with WebAssembly without recompilation
I've looked at Compiling Python to WebAssembly, and its various answers, various projects (EmPython, EmCPython, cpython-emscripten, Pyodide, etc.) but most of the time, it requires recompilation or ...
8
votes
0
answers
871
views
compiling cpp wasm module using skia library face to an error
I'm trying to use SKIA lib in my WASM solution. first I Compiled Skia to wasm bitcode using bellow config:
/bin/gn gen ./out/Build-wasm-Release/Release --args="cc=\"emcc\" extra_cflags_cc=[\"-frtti\",...