Skip to content

wasm: first-class JavaScript/TypeScript embedding surface #138

@Fieldnote-Echo

Description

@Fieldnote-Echo

Summary

Design a first-class JavaScript/TypeScript WASM embedding surface for ordvec.

This is an ecosystem compatibility issue. The core crate already targets wasm32, but browser and Node users need a clear package/API contract. ordvec should expose scoring primitives without owning application storage, metadata, or database lifecycle.

Proposed scope

Create a design and initial package plan for an ordvec-wasm surface, likely with wasm-bindgen or equivalent. Start with read-only primitives:

  • load/probe persisted RankQuant, Bitmap, and SignBitmap where practical
  • Float32Array query inputs
  • Uint32Array candidate/docset inputs
  • full search and subset rerank
  • explicit free()/lifetime rules
  • TypeScript declarations
  • Worker/browser/Node examples

Index building can be staged later and should align with Rust/C builder work.

Acceptance criteria

  • Design doc states package name, supported runtimes, memory/lifetime model, and API shape.
  • Node and headless-browser smoke tests run a fixture search.
  • TypeScript declarations ship with the package when implemented.
  • Docs make clear that storage, metadata, filters, and sync remain host responsibilities.
  • Uses runtime feature guidance for wasm SIMD where relevant.

Non-goals

  • No browser vector database.
  • No IndexedDB/OPFS storage layer by default.
  • No app framework or hosted service.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions