Questions tagged [wasmtime]
30 questions
1
vote
1 answer
Access Impl field from closure before field is alloc'ed in Rust?
I am new to Rust, as will probably be obvious.
Basically I have this scenario you can see below where, I create a new type that has a closure added to it, but this closure needs to access data which has not yet been created. The data will be created…

rygo6
- 1,929
- 22
- 30
0
votes
0 answers
Send/Return string from assemblyscript + wasmtime dotnet
I have the following assemblyscript function:
export function echo(str: string) : string {
return str;
}
and I have the following C# function (using wasmtime lib) to send and receive a string:
public string Echo(string str)
{
…

bbqchickenrobot
- 3,592
- 3
- 45
- 67
0
votes
0 answers
WasmTime dotnet - Generic print function in linker
I am using WasmTime dotnet and want to have a print function defined in the linker that will let me print i32 integer values and string values. Is there any way of doing this?
Part of my Wasm code:
(module
(import "env" "write" (func $write (param…

Troels Lund
- 31
- 2
0
votes
1 answer
Can't run a wasm file in mac using wasmtime
My go code
package main
import "fmt"
func main() {
fmt.Println("Hello Web Assembly!")
}
Then I build the wasm file using the following command
GOOS=js GOARCH=wasm go build -o main.wasm
I got main.wasm file. Then I installed wasmtime to run the…

ArulRulzz
- 87
- 6
0
votes
1 answer
fopen function is failed to open existing file in read mode (wasm platform)
I have compiled the following code using the emcc compiler
#include
#include
int main(int argc, char *argv[])
{
if(argc > 2 || argc < 2) {
printf("\nEnter the name of file \n");
return 0;
}
FILE…

Kiran Pawar
- 13
- 1
0
votes
0 answers
How does Wasmtime handle import functions with arbitrary signature?
I am writing a library in Rust where I need to take functions with arbitrary function signatures and store them in a Vector. This task is fairly challenging since Rust is not only strictly typed, but also needs to know sizes at compile time.
I was…

Konrad Koschel
- 193
- 9
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
2 answers
Is there a way to inspect a wasm module for imports
Let me explain a little bit about what I'm doing. I have an application that I'm embedding a wasm engine (specifically wasmtime) and writing the wasm in Rust. The target is not a browser so I'm not using wasm-bindgen. I'm trying to import two…

Zachary Whitley
- 25
- 3
0
votes
1 answer
Pass a pointer string as an argument in host import function in Rust WebAassembly (wasmtime)
so I have the following import in my generated .wast file (disclaimer: I have not written the wasm file myself):
(import "index" "bigDecimal.fromString" (func $fimport$1 (param i32) (result i32)))
and I need to write up the host import function in…

Pete
- 1
- 1
0
votes
1 answer
host can choose which system calls pass to each webassembly module
part of the talk of Lin Clark in https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webassembly-system-interface/:
It also gives us sandboxing because the host can choose which wasi-core functions to pass in — so, which system calls to…

capstonene
- 179
- 11
0
votes
0 answers
Register usage and WASM compiler
I am using Ubuntu on x86_64. I first generate non-optimized WebAssembly code from clang. The WebAssembly code is compiled into machine code using wasmtime which uses cranelift as compiling backend.
I am doing a simple matrix multiplication:
int…

yeehaw
- 159
- 2
- 11
0
votes
1 answer
Environment detection in WASM: Web, Node.js or standalone runtime?
There are many ways to run a WebAssembly module, besides Web, Node.js can load wasm module with --experimental-wasm-modules, standalone runtime like wasmtime and lucet can run it too.
So how do I detect the current environment in WASM and is it…

Jian
- 3,118
- 2
- 22
- 36
0
votes
1 answer
fopen failed when using wasi-libc
I tried to use fopen to read an image when using wasi-libc:
#include
int main()
{
FILE *f = fopen("test.png", "rb");
printf("file %p\n", f);
fclose(f);
}
Build the code with Clang:
$ clang --target=wasm32-wasi…

yushulx
- 11,695
- 8
- 37
- 64
0
votes
1 answer
Failed to build wasmtime in Windows 10
I tried to build wasmtime in Windows 10 but failed.
After running the command cargo build --release, I got the error message:
Done Building Project…

yushulx
- 11,695
- 8
- 37
- 64
-1
votes
2 answers
Cant run wasm module on cmd. Error: failed to run main module `demo.wasm`
Hi I'm new in programing in general I know just web dev. So I'm interested in develop in rust ussing webassembly wasm, wasmp-pack, webpack, wasi and in this case the runtime demo of wasmtime but Im stuck here and seriously I dont know even where
to…