Coder Social home page Coder Social logo

wasi-experimental-toolkit's Introduction

WASI Experimental Toolkit

WASI Experimental Toolkit

The goal of this proposal is to standardize the interfaces for functionality commonly used from WebAssembly modules, particularly running in non-browser environments.

Interfaces:

  • caching
  • logging
  • outbound HTTP

The interfaces in this repository are at a very early stages of development, and are intended to serve as a start for the standardization effort. Improvements and suggestions are highly encouraged at this point. A secondary goal of this repository is also to follow the development of the interface types proposal and wit-bindgen, and be in sync with the updates from that repository.

Building and testing

$ cargo build
$ cargo test --all -- --nocapture

Prerequisites

  • Redis installed so that redis-server is available
  • WASI SDK at v12+ in /opt/wasi-sdk/ (configurable in Makefile)
  • Rust at 1.56+ with the wasm32-wasi and wasm32-unknown-unknown targets configured

wasi-experimental-toolkit's People

Contributors

mossaka avatar nitishm avatar porges avatar radu-matei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wasi-experimental-toolkit's Issues

cannot find function `unlock` in module `os`

I'm trying to build a simple interface (for environment variables, as an experiment) and I'm running into this stack trace after adding my module to build.rs

   Compiling cranelift-codegen v0.80.0
   Compiling quote v1.0.15
   Compiling memoffset v0.6.5
   Compiling generic-array v0.14.5
   Compiling region v2.2.0
   Compiling cc v1.0.72
   Compiling regex v1.5.4
   Compiling pulldown-cmark v0.8.0
   Compiling rand_chacha v0.3.1
   Compiling miniz_oxide v0.4.4
   Compiling rustix v0.31.3
   Compiling wat v1.0.41
   Compiling crossbeam-epoch v0.9.6
error[E0425]: cannot find function `lock` in module `os`
  --> /Users/slyons/.cargo/registry/src/github.com-1ecc6299db9ec823/region-2.2.0/src/lock.rs:30:7
   |
30 |   os::lock(
   |       ^^^^ not found in `os`
   |
help: consider importing this function
   |
1  | use lock;
   |

error[E0425]: cannot find function `unlock` in module `os`
  --> /Users/slyons/.cargo/registry/src/github.com-1ecc6299db9ec823/region-2.2.0/src/lock.rs:60:7
   |
60 |   os::unlock(
   |       ^^^^^^ not found in `os`
   |
help: consider importing this function
   |
1  | use unlock;
   |

error[E0425]: cannot find function `page_size` in module `os`
  --> /Users/slyons/.cargo/registry/src/github.com-1ecc6299db9ec823/region-2.2.0/src/page.rs:16:39
   |
16 |     INIT.call_once(|| PAGE_SIZE = os::page_size());
   |                                       ^^^^^^^^^ not found in `os`

error[E0425]: cannot find function `set_protection` in module `os`
  --> /Users/slyons/.cargo/registry/src/github.com-1ecc6299db9ec823/region-2.2.0/src/protect.rs:48:7
   |
48 |   os::set_protection(
   |       ^^^^^^^^^^^^^^ not found in `os`

error[E0425]: cannot find function `get_region` in module `os`
   --> /Users/slyons/.cargo/registry/src/github.com-1ecc6299db9ec823/region-2.2.0/src/lib.rs:133:7
    |
133 |   os::get_region(page::floor(address as usize) as *const u8)
    |       ^^^^^^^^^^ not found in `os`

For more information about this error, try `rustc --explain E0425`.
error: could not compile `region` due to 5 previous errors
warning: build failed, waiting for other jobs to finish...
error: build failed

I must admit this is my first foray into the WASI SDK/toolkit so I'd appreciate any advice.

Error handling in tests is not clear

The current way errors are handled in tests is not at all clear.
Theoretically, test implementations could return an error, but the test runtime ignores the errors, even when unwrapped.

This could (?) be an issue in the way the Wasmtime import bindings handle expected<_, error>.

Implement logging interface

There are now a few examples for both host and guest implementations for an interface, so implementing the current logging interface should be straightforward.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.