Getting started
laneops applies typed vector operations to one-dimensional, contiguous arrays. A shared Rust core runs through a Node-API addon in Node.js or WebAssembly in browsers. The package has no runtime dependencies.
Install a candidate
This repository currently describes an unpublished 0.1.0 candidate. To try a local build:
pnpm install --frozen-lockfile
pnpm build
pnpm pack --out artifacts/packagesIn a separate consumer project, install the resulting archive:
pnpm add /absolute/path/to/laneops-0.1.0.tgzAfter a version is published, registry installation will be pnpm add laneops. Consumers use prebuilt native and Wasm assets and do not need Rust. The Node entry requires ESM and Node.js ^22.18.0 || ^24.11.0 || >=26.0.0. See development for build prerequisites.
Create an engine
import { createVectorEngine } from 'laneops'
const engine = await createVectorEngine()
try {
const left = new Float32Array([1, 2, 3])
const right = new Float32Array([10, 20, 30])
const sum = engine.f32.add(left, right) // [11, 22, 33]
engine.f32.mul(sum, 0.5, { out: sum }) // [5.5, 11, 16.5]
console.log(engine.info) // e.g. { backend: 'native', kernel: 'neon' }
} finally {
engine.dispose()
}Initialization is asynchronous; all arithmetic and scope callbacks are synchronous.
Choose the right execution model
| Need | Start here |
|---|---|
| Calculate with existing TypedArrays | Operations |
| Reuse data across multiple calls | Resident buffers |
| Fuse a supported chain into one traversal | Pipelines |
| Keep long calculations off the main thread | Workers |
| Configure native, Wasm or SIMD selection | Backends |
| Bundle Wasm and Worker assets | Browsers and Vite |
Compatibility
Numeric types use separate namespaces; convert explicitly between them. Ordinary operations, out and scope callbacks are synchronous after engine initialization. Use persistent arenas for longer data lifetimes and Workers for asynchronous pipelines.
Custom JS, native, Wasm and Worker assets must come from the same build. The ABI and registry fingerprint reject incompatible binaries during initialization. Inspect error.name for Worker cancellation; complete error messages are not a stable API. The support matrix distinguishes callable operations, explicit SIMD implementations and verified targets.