AssemblyScript implementation of the JAM PVM (64-bit).
- Memory
- JAM tests compatibility
- 64-bit & new instructions (GrayPaper v0.5.0)
- GP 0.5.4 compatibility (ZBB extensions)
- Pineapples are cool.
- JAM is promising.
- PVM is neat.
- Potentially as an alternative implementation for
typeberry. - To test out the PVM debugger.
npm install @fluffylabs/anan-asThe package exports multiple builds to suit different use cases:
ESM bindings provide a convenient JavaScript wrapper around the WebAssembly module:
// Default import (optimized release build with ESM bindings)
import ananAs from '@fluffylabs/anan-as';
// Debug build (includes source maps and debug info)
import ananAs from '@fluffylabs/anan-as/debug';
// Explicit release build
import ananAs from '@fluffylabs/anan-as/release';
// Release build with minimal runtime (requires manually calling GC)
import ananAs from '@fluffylabs/anan-as/release-mini';
// make sure to call GC after multiple independent runs
ananAs.__collect();Raw bindings give you direct access to WebAssembly exports without the JavaScript wrapper layer. This is useful for instantiating multiple instances or when you need more control:
// Raw bindings
import { instantiate } from '@fluffylabs/anan-as/raw';
// Import WASM file URLs
import debugWasm from '@fluffylabs/anan-as/debug.wasm';
import releaseWasm from '@fluffylabs/anan-as/release.wasm';
// Use with your own loader
const module = await WebAssembly.instantiateStreaming(
fetch(releaseWasm),
imports
);
const ananAs = await instantiate(module);When installing the package, you can choose between stable releases and bleeding-edge builds:
# Latest stable release
npm install @fluffylabs/anan-as
# Latest build from main branch (includes commit hash)
npm install @fluffylabs/anan-as@nextTo download the dependencies:
npm ciTo build the WASM modules (in ./build/{release,debug}.wasm):
npm run buildTo run the example in the browser at http://localhost:3000.
npm run webTo run JSON test vectors.
npm start ./path/to/tests/*.json