58 questions
1
vote
0
answers
146
views
How to make a TLS connection from Rust WASM code in WASI?
How do I make an outbound TLS connection (not HTTPS) from within WASM in Rust? Using WASI of course (not inside a browser). I've tried tokio_native_tls and rustls. Both fail to compile, saying that ...
0
votes
1
answer
439
views
Cannot load wasm component because of missing wasi:cli import
I am trying to load a wasm-component I wrote as a plugin in my rust app. Project is made of two main parts app and add: app contains the host application, add contains the plugin. The add plugin is ...
1
vote
0
answers
136
views
Why CGo-based build targeting GOOS=wasip1 failed
I cannot build a cgo-based project targeting GOOS=wasip1. Here is github repository helping reproduction.
Environment
Go 1.22.4
Debian 12
Output of go env command goes as
GO111MODULE=''
GOARCH='...
1
vote
1
answer
104
views
WebAssembly wait & notify not working across wasi threads
I'm trying to make a thread_join function in WebAssembly by setting a mutex to 1 in the main thread, and then launching a thread. the thread unlocks its mutex before exiting. the main thread can get ...
0
votes
1
answer
155
views
wasmtime example doesn't run
I am currently exploring the add example for wasm component which is wasi-0.2, from wasmtime component doc diligently following their example, unfortunately it doesn't run
#[allow(warnings)]
mod ...
1
vote
1
answer
156
views
What is the best way to compile Python code to WASI?
I have a Python script that reads a file from a path. For what I know, compiling the script to WebAssembly will require to make use of WASI, as the script needs to access system calls to read the file....
1
vote
0
answers
236
views
golang wasm:Remove the content of golang compilation wasm import wasi_snapshot_preview1
When I use Golang to compile into wasm, (import "wasi_snapshot_preview1" "fd_write" (func $runtime.fd_write (type 2))) will be introduced, but the environment running wasm does not ...
2
votes
1
answer
740
views
Accessing file system with Go WASI throws "Bad file number" error
I'm trying out Go's newly added support for the WebAssembly System Interface (WASI). I'm attempting to access OS resources, such as the file system.
package main
import "os"
func main() {
...
2
votes
0
answers
139
views
Golang cannot compile wasmer
Am trying to build a simple go file, with the following contents:
package main
import (
_ "embed"
"fmt"
"log"
"github.com/mattn/gowasmer"
)
//...
1
vote
1
answer
747
views
How to produce single WASM file using WASI SDK C#
How to produce single WASM file using .NET WASI SDK? Here is my project file
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework&...
4
votes
0
answers
598
views
How to import wasi in C (wasm2c)?
I transfer a wasi-wasm to C file via wasm2c.
wasm2c test.wasm -o test.c
And I got a header file and a source C file. Part of the header file shows here.
/* import: 'wasi_snapshot_preview1' 'args_get' ...
0
votes
1
answer
2k
views
WASI: wasm-ld symbol not found
The following short c example uses the standard c library and therefore requires the wasi sdk:
#include <stdio.h>
int main(void)
{
puts("Hello");
return 0;
}
When compiling ...
3
votes
0
answers
106
views
Where can I find up-to-date status for implementation of WASI proposals?
I am exploring standalone WASM/WASI runtimes like Wasmtime/Wasmer and I am wondering where can I find up-to-date information regarding their current implementation of the WASI proposals?
I tried their ...
1
vote
0
answers
200
views
cannot load precompiled module `demo.wasm` unless --allow-precompiled is passed
I'm trying to follow a WASI-tutorial but all I'm getting are errors. I'm currently using wasmtime-cli version 1.0.0, and clang 14.0.0.
The tutorial has 3 simple steps.
save sample code to demo.c. ...
3
votes
0
answers
408
views
How to use .witx definitions for Go code generation to use with TinyGo WebAssembly targeting WASI?
Is it possible to use .witx definition files for Go code generation to use with TinyGo's WebAssembly WASI (WebAssembly System Interface) support?
Specifically, I want to create a Fastly Compute@Edge ...
1
vote
2
answers
753
views
Node WASI vs spawning a child process
In the NodeJS docs it states the following:
The WASI API provides an implementation of the WebAssembly System Interface specification. WASI gives sandboxed WebAssembly applications access to the ...
0
votes
1
answer
408
views
How to run in wee8 wasm code that was compiled from c++ with emcc? (WASI in wee8?)
I am trying to compile C++ code to wasm and then embed it in other C++ code with wee8 (v8's wasm-api). Currently I'm getting a Segfault on instantiating the module:
auto instance = wasm::Instance::...
2
votes
1
answer
1k
views
Wasmtime WASI communication via HTTP/sockets
There is awesome webassembly compiler&vm named Wasmtime, which provide support for execution without any kind of embedding, which allows run WASM applications direcly from command line https://...
0
votes
1
answer
915
views
ABI format of WASI functions
I am building a Webassembly runtime and am currently implementing the WASI APIs. I'm wondering how the ABI looks like, according to this document: https://github.com/WebAssembly/WASI/blob/main/phases/...
3
votes
0
answers
947
views
WASI and JVM - OS Abstraction
My question is if the JVM actually provides a virtual operating system too, similar to how WASI does.
As for my understand WASM and JVM are both virtual machines, providing an environment to execute ...
1
vote
1
answer
5k
views
Calling console.log from rust wasm32-wasi without the need for ssvm/ssvmup
I would like to debug using messages to the console.log.
We have a rust wasm32-wasi function being called from javascript running in nodejs. We can not use ssvm/ssvmup due to other restrictions.
Is ...
1
vote
1
answer
2k
views
WASI vs Emscripten FS, sand-boxed file system
As I know, WASI gives sand-boxed WebAssembly applications access to the underlying operating system and also Emscripten FS provides several file systems such, NODEFS. My question is both WASI and ...
0
votes
1
answer
47
views
Storing version in WebAssembly application
I've got REST service written in C++/Qt 5.15.x. Under some URL REST service sends WASM stuff. It's a GUI application (REST client) written in C++/Qt 5.15.x. It is possible to embed some function which ...
9
votes
1
answer
5k
views
What is the difference between Emscripten and Clang in terms of WebAssembly compilation?
I know both Clang (by use target=wasm32) and Emscripten can compile C code into WebAssembly, but how are they different?
It looks like they both use LLVM as the backend. Actually, I do not even quite ...
0
votes
2
answers
2k
views
How to call WASI functions directly in C using wasi-sdk (import module problem)
I'm trying to call a WASI function (fd_write) directly in a C program using wasi-sdk. This is the the library (lib.c):
#include <stdint.h>
struct Ciovec
{
uint8_t *buf;
uint32_t buf_len;...