bytecodealliance / bytecodealliance/wasmtime

C binding: wasi std out to string

Open
#4,372 5 comments 7 reactions 0 assignees View on GitHub
wasmtime:c-api
Dominant language
Rust
Stars
18.6k
Forks
1.8k
Avg merge
1d 18h
Merged PRs (30d)
126

Description

#### Feature

Rust library can bind WritePipe to WasiCtx stdout which can be far simpler and effective than OS files went dealing with multiple short-lived instances.

It is not currently possible with C/C++ bindings

#### Benefit

- Avoid useless error-prone and slow interactions by filesystem
- Allow simpler integration in freestanding targets

#### Implementation

Leverage existing [wasi_common](https://docs.rs/wasi-common/0.38.1/wasi_common/index.html)::[pipe](https://docs.rs/wasi-common/0.38.1/wasi_common/pipe/index.html)::[WritePipe](https://docs.rs/wasi-common/0.38.1/wasi_common/pipe/struct.WritePipe.html#) and ReadPipe on the rust side to implemented a binding in `c-api` crate.

#### Alternatives

Export some basic filesystem operations in c binding

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.