Questions tagged [rust-wasm]
121 questions
0
votes
2 answers
WasmEdge or WebAssembly || Is it truly container less?
I am interested in wasmEdge(webassembly) and trying to understand it.
I looked all over google, but didn't find the answer to is wasmEdge is truly containerless.
I believe it still uses containers CRI-o crun or containerd, but why people claim it to…

adroit
- 1
0
votes
0 answers
How do I exclude a code block depending on the target arch?
I am working on a crate which may target wasm, with some fewer features.
The Cargo.toml excludes some dependencies when targeting wasm:
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
foo = { path = "../crates/some/path" }
In my code, I…

sak
- 2,612
- 24
- 55
0
votes
1 answer
Why I cannot find the compiled wasm file?
I am new to the WASM world. I tried to create a really simple rust lib that only contains add function and wants to compile it to the .wasm. I already know that the wasm-pack can achieve this. But why the cargo build --target wasm32-unknown-unknown…

boundless-forest
- 387
- 2
- 9
0
votes
1 answer
What are the numbered functions in .wat files compiles with emcc?
I am compiling my Rust code which has a linked in C++ static library to wasm32-unknown-emcc. Out of curiosity, I converted the generated wasm file to a .wat file for better readability and saw this at the top. I understand the last line, as I can…
user8352734
0
votes
0 answers
Guaranteeing struct layout for wasm in vector of structs
When using a vector of #[wasm_bindgen] structs in javascript, is there a guarantee that the order of the struct's fields will be maintained so that bytes in wasm memory can be correctly interpreted in JS? I would like to be able to have a vector of…

BallpointBen
- 9,406
- 1
- 32
- 62
0
votes
0 answers
How to send values bigger than i8 from JS through wasm-memory to Rust?
Currently I'm trying to send values bigger than i8 from JS through wasm-memory to Rust like so:
Rust:
// CREATE WASM MEMORY FOR RUST AND JS DIRECT USE.
const WASM_MEMORY_BUFFER_SIZE: usize = 2; // 2 SLOTS
static mut WASM_MEMORY_BUFFER: [u8;…

23rfew
- 31
- 8
0
votes
1 answer
Production config Webpack build for a Rust, WebAssembly app to apache2 server
I have a Rust, Web assembly wasm app I need to deploy to an apache server. When upload the build, it doesn't run the software, it just shows a list of the files.
The build files look like this:
build
-0.bootstrap.js
-bootstap.js
…

Shingai Munyuki
- 551
- 1
- 11
- 25
0
votes
1 answer
How can I create a wasm_bindgen Closure which captures a Rc> without moving out of it?
I have state that needs to be mutated multiple times by JavaScript callbacks (it's a game, so input from the user needs to modify the game state). I can't seem to figure out how to do it though. This is the simplest example I can think of that…

Michael Dorst
- 8,210
- 11
- 44
- 71
0
votes
0 answers
What is WASM Engine and how to Embed WASM Engine?
Is there any concept of Wasm Engine and how to embed it, show that we can run any program which is in web assembly?

Ajit
- 338
- 1
- 10
0
votes
0 answers
Running wasm module with wasmer cli
I am starting out with web-assembly following this guide: https://depth-first.com/articles/2020/06/29/compiling-rust-to-webassembly-a-simple-example/
When I compile the source with cargo build --target wasm32-unknown-unknown --release i get a .wasm…

Kevin
- 3,096
- 2
- 8
- 37
0
votes
1 answer
Using Wasm with data-fusion
I am very beginner using Rust but I am trying to create a project to implement Webassembly and using a library called data-fusion, the problem is the compilation fails with the message:
error: failed to run custom build command for `zstd-sys…

MrElephant
- 302
- 4
- 26
0
votes
2 answers
Conways game of Life with 1D array
Right now I'm doing this tutorial for WebAssembly with Rust. The task is to implement Conways Game of Life in Rust. Writing a low-level language like Rust is new for me, but with my prior experience in coding I understand most of the syntax.
The…

hmaier
- 53
- 1
- 6
0
votes
0 answers
Getting error while using #[js_export] from crate stdweb
I need to read client file in a rust-wasm program and I am trying two solution given on stackoverflow https://stackoverflow.com/a/51231915 and https://stackoverflow.com/a/69305956/4466255. Both these solutions are accepted and given bounties so I am…

Kushdesh
- 1,118
- 10
- 16
0
votes
1 answer
Get parameters from web_sys::File in rust
I'm sending a FileList from JavaScript and trying to read the parameters of the specific file from the list, like the file name but I'm getting the error:method not found in Option (I'have tried different variants to call the getter…

Sheki
- 1,597
- 1
- 14
- 25
0
votes
1 answer
Using polars’ query engine in wasm for a file loaded from the web-page
I am trying to implement a simple web app using a web assembly created with wasm-bindgen. I am entirely new to Rust.
The web page would have a file input element to select a CSV file. The web-assembly code would load this CSV and use polars to…

sovo2014
- 487
- 7
- 17