Skip to content

ArchitBhonsle/arrays.wasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📐 arrays.wasm 📏

Linear Algebra powered by Web Assembly

This project is currently in alpha and missing some crucial features

docs | npm

Quick Start

Here, to demonstrate, we'll be using vite to scaffold a project:

npm init vite@latest  # choose a simple vanilla js project
npm i vite-plugin-cross-origin-isolation
npm i @ml.wasm/linalg

And add this to main.js:

import init, {
  initThreadPool,
  IntegersVector,
  FloatsVector,
  StringsVector,
  IntegersMatrix,
  FloatsMatrix,
  StringsMatrix,
} from 'arrays-wasm';

(async () => {
  // This init function sets up everything you need to use this library
  await init();

  // This sets up the concurrency
  await initThreadPool(navigator.hardwareConcurrency);

  // All your code goes here...
})();

Note that you'll have to create a vite.config.js:

import crossOriginIsolation from 'vite-plugin-cross-origin-isolation'

export default {
  plugins: [
    crossOriginIsolation()
  ],
  server: {
    fs: {
      allow: ['..']
    }
  }
}

About

Linear Algebra in the Browser powered by WebAssembly

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published