Skip to content

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:

sh
pnpm install --frozen-lockfile
pnpm build
pnpm pack --out artifacts/packages

In a separate consumer project, install the resulting archive:

sh
pnpm add /absolute/path/to/laneops-0.1.0.tgz

After 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

ts
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

NeedStart here
Calculate with existing TypedArraysOperations
Reuse data across multiple callsResident buffers
Fuse a supported chain into one traversalPipelines
Keep long calculations off the main threadWorkers
Configure native, Wasm or SIMD selectionBackends
Bundle Wasm and Worker assetsBrowsers 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.

Released under the MIT License.