Rust bindings for the Wasm spec interpreter.

Overview

wasm-spec-interpreter

This project shows how to use ocaml-interop to call into the Wasm spec interpreter. There are several steps to making this work:

  • building the OCaml Wasm spec interpreter as a static library
  • building a Rust-to-OCaml FFI bridge using ocaml-interop and a custom OCaml wrapper
  • linking both things into a Rust crate

Dependencies

This crate only builds in an environment with:

  • make (the Wasm spec interpreter uses a Makefile)
  • ocamlopt, ocamlbuild (available with, e.g., dnf install ocaml)
  • Linux tools (e.g. ar); currently it is easiest to build the static libraries in a single environment but this could be fixed in the future (TODO)
  • libgmp, for the OCaml zarith package
  • git is used by build.rs to retrieve the repository containing the Wasm spec interpreter; it is safe to completely remove ocaml/spec to get a new copy

Build

cargo build --features build-libinterpret

Use FFI_LIB_DIR=path/to/lib/... to specify a different location for the static library (this is mainly for debugging). If the build-libinterpret feature is not provided, this crate will build successfully but fail at runtime.

Test

cargo test --features build-libinterpret
You might also like...
Lisp interpreter that might be fast someday maybe?

ehlisp Pronunciation I'm not really sure. Maybe like an incorrect pronunciation of "ellipse", like "ellisp"? Also maybe like "a lisp". I named it this

📦✨ your favorite rust -> wasm workflow tool!
📦✨ your favorite rust - wasm workflow tool!

📦 ✨ wasm-pack Your favorite Rust → Wasm workflow tool! Docs | Contributing | Chat Built with 🦀 🕸 by The Rust and WebAssembly Working Group About Th

Gun port in rust & wasm

gun-rs-wasm Rust & WASM port of Gun. For a non-wasm version, check out gun-rs Example (source) Use npm install rusty-gun import { Node as Gun } from "

📝 A template for creating WASM + Typescript + Rust workflow libraries.
📝 A template for creating WASM + Typescript + Rust workflow libraries.

Create Rust + TypeScript libraries with ease! PR'S WELCOMED! ✨ Inspiration I wanted to create a WebAssembly/Rust library with additional JS features,

Parametric surfaces drawn using the Rust + WASM toolchain with WebGL, React, and TypeScript.

Parametric Surfaces in the Browser My.Movie.3.mp4 Wanted to experiment with WebGL using the Rust + WASM toolchain, with React and TypeScript to glue e

Rust implementation of the Mina protocol, targeting Wasm and ARM architectures.

Mina-rs An implementation of Mina protocol in Rust, with focus on web and Wasm compatibility ** As you can probably tell this is a WIP! Don't use for

A self-guided learning project that includes Rust + Wasm together
A self-guided learning project that includes Rust + Wasm together

A self-guided learning project that includes Rust + Wasm together. Who knows, maybe Typescript and React joins too..

Realtime audio processing / synthesis using Rust/WASM in the browser.
Realtime audio processing / synthesis using Rust/WASM in the browser.

Rust Audio About This repo is my investigation into using Rust for creative audio coding on various platforms (e.g. desktop, web, etc.), but especiall

Spine runtime for Rust (and wasm!) transpiled from the official C Runtime.

rusty_spine Spine runtime for Rust (and wasm!) transpiled from the official C Runtime. Supports Spine 4.1. [dependencies] rusty_spine = "0.4.0" Onlin

Comments
  • Add `LICENSE` file

    Add `LICENSE` file

    This crate was previously licensed under the Apache v2 license covering the Wasmtime crates. This change brings the LICENSE file over to the new repository.

    opened by abrown 0
Owner
Bytecode Alliance
Bytecode Alliance
Rust bindings for the Python interpreter

PyO3 Rust bindings for Python. This includes running and interacting with Python code from a Rust binary, as well as writing native Python modules. Us

PyO3 7.2k Jan 4, 2023
Pyo3 - Rust bindings for the Python interpreter

PyO3 Rust bindings for Python, including tools for creating native Python extension modules. Running and interacting with Python code from a Rust bina

PyO3 7.2k Jan 2, 2023
Distribute a wasm SPA as HTML by wrapping it as a polyglot "html+wasm+zip"

A packer that adds a webpage to WASM module, making it self-hosted! Motivation At the moment, Browsers can not execute WebAssembly as a native single

Andreas Molzer 3 Jan 2, 2023
Rust based WASM/JS bindings for ur-rust

ur-wasm-js WASM/JS bindings for the ur-rust rust library Getting started Installation Either build the library yourself with wasm-pack or install for

Lightning Digital Entertainment 5 Feb 28, 2024
WASM bindings for React - enables you to write and use React components in Rust

This library enables you to write and use React components in Rust, which then can be exported to JS to be reused or rendered.

Yichuan Shen 55 Dec 24, 2022
A simple Pascal interpreter written in rust.

rascal A simple Pascal interpreter written in rust. Usage Download the latest rascal executable from the release page. Run the executable. rascal.exe

null 47 Dec 7, 2022
RustPython - A Python Interpreter written in Rust

RustPython A Python-3 (CPython >= 3.9.0) Interpreter written in Rust ?? ?? ?? . Usage Check out our online demo running on WebAssembly. RustPython req

null 13.3k Jan 2, 2023
A simple interpreter language written in Rust.

Glang Backstory Hello and welcome to the Glang git repository. Game Slang or in short Glang is a super simple interpreted language written in Rust wit

null 6 Nov 12, 2022
A memory safe Lua interpreter

Hematita Da Lua Hematita Da Lua is an interpreter for the scripting language Lua, written entirely in 100% safe Rust. Hematita is the portugese word f

Daniel 149 Dec 29, 2022
An interpreter for the esoteric programming language, Brainf*ck.

Brainf*ck Interpreter This is just a normal Brainf*ck interpreter written in Rust. If you don't know what Brainf*ck is, you can check out the wikipedi

Callum Irving 0 Dec 23, 2021