JanKaul / weblab-ndarray

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

weblab-ndarray

Efficient wasm-implementation of an n-dimensional Array for Javascript

Wasm restrictions on Rust (at least at wasm boundary):

  • No generics
  • No polymorphims (no traits)
  • No lifetimes

Solutions:

  • no generics => enum NdarrayUnion for different type parameters for Ndarray
  • no polymorphism => enum Subview for different behavior of ndarrays
  • no lifetimes => Using if reference counting (std::rc::Rc), unsafe

Using enums requires minimally more memory (2 enums = 2 Byte)

About

License:Apache License 2.0


Languages

Language:Rust 95.6%Language:JavaScript 3.5%Language:HTML 0.8%