Skip to main content

Module wasm

Module wasm 

Source
Expand description

WASM/WASI interface for Hypen Engine

This module provides bindings for running the engine in WASM environments. Two interface types are available:

§JavaScript Runtimes (js feature)

For Node.js, Bun, Deno, and browsers. Uses wasm-bindgen for seamless JavaScript interop with native JS types and callbacks.

[dependencies]
hypen-engine = { features = ["js"] }

§WASI Runtimes (wasi feature)

For Go (wazero, wasmtime-go), Python (wasmtime, wasmer), Rust, and other languages that embed WASM via WASI. Uses a C-compatible FFI with JSON serialization for data exchange.

[dependencies]
hypen-engine = { features = ["wasi"] }

§Feature Flags

  • js - Enable JavaScript bindings via wasm-bindgen (default for wasm-pack builds)
  • wasi - Enable WASI-compatible C FFI bindings

These features are mutually exclusive. If both are enabled, js takes precedence.

Modules§

ffi
Shared FFI utilities for WASM bindings