package wasmtime

  1. Overview
  2. Docs
Wasmtime bindings for OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

v0.0.2.tar.gz
md5=87759321ed91f5de130572cfbbb9138c
sha512=1cd5382a2cf725faa2d7e224cbc00f41ed4309a655d9b8f6f53beadac607d5c61029910e3e3f1ed44a025f9a2ce5b4fbe90b8638309a1cefd46a33a146526e6b

Description

Bindings for Wasmtime, a small and efficient runtime for WebAssembly.

Published: 16 Dec 2020

README

ocaml-wasmtime

OCaml WebAssembly runtime powered by wasmtime

This library let you run WebAssembly modules within OCaml with some support for wasi for system calls. It acts as a low-level and typesafe wrapper around the wasmtime C library, only a subset of the functions are supported for now but it should be enough to run some basic examples, see the tests directory for details.

Installation

Using Opam

The simplest way to install this library is via opam, this installs both the C library and the OCcaml bindings.

opam install wasmtime
Building from source

First the wasmtime C library has to be installed. This can either be done via opam.

opam install libwasmtime

Or this can be done manually.

  • Download the wasmtime c-api library from the github repo.

  • Uncompress the archive and set the LIBWASTIME environment variable to point at them.

wget https://github.com/bytecodealliance/wasmtime/releases/download/v0.21.0/wasmtime-v0.21.0-x86_64-linux-c-api.tar.xz
tar xf wasmtime-v0.21.0-x86_64-linux-c-api.tar.xz
export LIBWASTIME=$PWD/wasmtime-v0.21.0-x86_64-linux-c-api

Once the C library has been installed and the repo has been checked out, the examples can be rune with dune.

dune runtest

This has been tested with wasmtime v0.21.0 on a linux platform.

Dependencies (8)

  1. stdio
  2. ocaml >= "4.10"
  3. libwasmtime >= "0.21.0" & < "0.22.0"
  4. dune-configurator
  5. dune >= "2.7.0"
  6. ctypes-foreign
  7. ctypes >= "0.5"
  8. base >= "v0.13.0" & < "v0.17"

Dev Dependencies (1)

  1. ppx_expect >= "v0.13.0" & < "v0.15" & with-test

Used by

None

Conflicts

None

OCaml

Innovation. Community. Security.