Hylograph.Kernel.WASM
- Package
- purescript-hylograph-wasm-kernel
- Repository
- afcondon/purescript-hylograph-wasm-kernel
The Rust/WASM force kernel of hylograph-simulation, carried inside
this package: the compiled module travels as base64 in this module's
foreign file, so nothing has to be built, served or fetched.
import Hylograph.Kernel.WASM as Kernel
main = launchAff_ do
Kernel.install
-- engine: WASM and Stepped.Rust now work
The foreign file is generated from the kernel's source by generate.mjs
in this package's repository; its header names the kernel commit and the
tools it was built with.
#load Source
load :: Aff KernelModuleDecode the embedded module, instantiate it, and give back the initialised kernel. No network request is made. The kernel is instantiated once per JavaScript realm; later calls give back the same one.
Re-exports from Hylograph.ForceEngine.WASM
#KernelModule Source
data KernelModuleThe kernel's wasm-bindgen module, already instantiated: what the
loader generated by wasm-pack (--target web) exports once its
default export has been awaited, with Simulation among its exports.
Made by whatever carries the module (the hylograph-wasm-kernel
package makes one from bytes it carries) and handed to
installKernel.
- Modules
- Hylograph.
Kernel. WASM