All Questions
Tagged with webassembly rust-wasm
74
questions
0
votes
0
answers
36
views
Npm cannot find an executable while running the create-wasm-app JavaScript project template
I have been following a Rust + WebAssembly Tutorial and on the 2nd part of the 2nd chapter, after looking into the files and telling you how to build them, the tutorial asks you to run this command: ...
-1
votes
0
answers
27
views
How to Integrate Wasmer (WASM) with Swift iOS Project?
I am working on an iOS project where I need to integrate a WebAssembly (Wasm) module using the Wasmer runtime. I have successfully compiled my code into a .wasm file, but I am struggling with ...
0
votes
0
answers
47
views
Calling wasm code from rust through wasm-bindgen
I have inherited a .wasm binary that was initially compiled from Rust with wasm-bindgen. I need to call this binary from Rust. For this sake, I'm using wasmtime.
I have dutifully bound all the exports,...
0
votes
1
answer
78
views
WASM module not loaded inside web worker
I'm failing to load a simple WASM function, which sums two numbers, inside my web worker.
I tried it inside my main/index script which is working fine. However, moving the code into the web worker ...
1
vote
0
answers
146
views
Build a wasm module from Rust to be used as a plugin for a Rust process reading it with Wasmer
I have a Rust project that wants to consume plugins distributed as wasm modules. The guides I see online are largely for running building/running wasm modules on the web and not exactly my use case.
I ...
0
votes
1
answer
574
views
Achieve multi threading in WASM for making http requests (using reqwest crate)
I am trying to convert current implementation to WASM (for cloudflare workers).
But I have been facing problem with current implementation is that it uses multi threading to make requests, but I am ...
0
votes
0
answers
181
views
How to return structs, Result, Option from Rust in WASM?
This question is based on this discussion.
I need to return different structures, Option, Result.
I noticed the externalref crate, but it is in experimental status and I can't use it.
I was trying to ...
0
votes
1
answer
1k
views
Read a file with Rust WASM
I am trying to read a file called Book.txt within my Rust yew app. I am serving Book.txt using trunk's copy-file so that it is accessible from http://localhost:8080/Book.txt.
Trying to read the file ...
-1
votes
1
answer
498
views
Unable to build wasm-pack project - `wasm-opt` download failed
wasm-pack is unable to download the required tools for optimizing wasm-opt.
This fails the build. I'm left with only option of disabling wasm optimizations with wasm-opt = false.
$ wasm-pack build
...
0
votes
0
answers
244
views
Trunk doesn't recognize reqwest features
I'm trying to run a Yew app using Trunk that uses reqwest to get contents of a GitHub repo. For that, I need some extra reqwest features, but Trunk throws out this error:
error[E0433]: failed to ...
3
votes
1
answer
2k
views
Calling a WASM function that returns a string from Wasmtime
At a high level I am trying to create a Rust host program that loads a WASM module at runtime using Wasmtime and calls a WASM function that returns a string. I can get this working with numeric types ...
1
vote
1
answer
646
views
How to compile Rust for use with WASM's Shared Memory?
When I run a loop in different Web Workers, the loop shares the counter variable across threads despite that the variable should be thread-local. It should not do this, but I don't know how to fix it.
...
1
vote
0
answers
83
views
Twiggy command line options for emcc / emscripten to get meaningful data out
I'm using Twiggy from the Rust Wasm Toolchain to analyse a webassembly package to find largest contributors to code size.
Command line option
twiggy top -n 20 myWasm.wasm results in a table output ...
0
votes
2
answers
273
views
Using a function from a wasm module in JavaScript
I've decided to learn Rust alongside Web Assembly to get into more cloud computing. I'm trying to make a Rust app that connects to a Redis cache and increments a value each time a function is called. ...
5
votes
1
answer
445
views
How to embed a wasm artifact generated by one crate in a cargo workspace in a rust binary generated by another crate in the same workspace?
I have a cargo workspace organized like this:
Cargo.toml
|-foo
| |-Cargo.toml
| -src
| |-main.rs
|-foo-runtime
| |-Cargo.toml
| -src
| |-lib.rs
|-target
main.rs has code somewhere that looks ...