#wasi #lucet #wasi-common

wasi-common-lucet

wasi-common wrappers for Lucet

13 unstable releases (3 breaking)

0.4.2 Feb 6, 2020
0.4.1 Jan 24, 2020
0.3.0 Nov 1, 2019
0.2.0 Oct 31, 2019
0.1.4 Sep 5, 2019

#1526 in WebAssembly

ISC license

21KB
592 lines

Released API docs

WASI-common wrappers for Lucet

A crate to use the reference WASI implementation in WebAssembly modules run with Lucet.

  • Call wasi_common_lucet::export_wasi_funcs() once in order to have the symbols exported
  • Create a new isntance with WasiCtx::new(). Note that the function signature slightly differs from the lucet-wasi one.
  • Register it into Lucet instances using insert_embed_ctx().
use wasi_common_lucet::WasiCtx;

fn doit() -> Result <(), Error> {
    wasi_common_lucet::export_wasi_funcs();
    // ...
    let mut lucet_instance_handle = lucet_dylib.instantiate(region)?;
    let wasi_ctx: WasiCtx = WasiCtx::new(["app"].iter())?;
    lucet_instance_handle.insert_embed_ctx(wasi_ctx);
    // ...
}

Dependencies

~14–22MB
~337K SLoC

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy