Expand description
§SciRS2-WASM: WebAssembly Bindings for SciRS2
High-performance scientific computing in the browser and Node.js.
§Features
- Pure Rust: 100% safe Rust code compiled to WASM
- SIMD Support: Optional WASM SIMD (wasm32-simd128) acceleration
- Async Operations: Non-blocking computations with async/await
- TypeScript Support: Full TypeScript type definitions
- Memory Efficient: Optimized memory management for browser environments
- Zero-copy: Direct array buffer access when possible
§Modules
array: N-dimensional array operationslinalg: Linear algebra (matrix operations, decompositions)stats: Statistical functions (distributions, tests, descriptive stats)fft: Fast Fourier Transform operationssignal: Signal processing (filtering, convolution, wavelets)integrate: Numerical integration and ODE solversinterpolate: Interpolation (linear, spline, Lagrange, PCHIP, Akima)optimize: Optimization algorithms (minimize, curve fitting)random: Random number generation and distributions
§Example Usage (JavaScript)
import * as scirs2 from 'scirs2-wasm';
// Initialize the library
await scirs2.default();
// Create arrays
const a = scirs2.array([1, 2, 3, 4]);
const b = scirs2.array([5, 6, 7, 8]);
// Perform operations
const sum = scirs2.add(a, b);
const dot = scirs2.dot(a, b);
// Statistical operations
const mean = scirs2.mean(a);
const std = scirs2.std(a);
// Linear algebra
const matrix = scirs2.array2d([[1, 2], [3, 4]]);
const inv = scirs2.inv(matrix);
const det = scirs2.det(matrix);Modules§
- array
- N-dimensional array operations for WASM
- error
- Error types for WASM bindings
- fft
- Fast Fourier Transform (FFT) operations for WASM
- integrate
- Numerical integration and ODE solver functions for WASM
- interpolate
- Interpolation functions for WASM
- linalg
- Linear algebra operations for WASM
- optimize
- Optimization algorithms for WASM
- random
- Random number generation for WASM
- signal
- Signal processing operations for WASM
- stats
- Statistical functions for WASM
- utils
- Utility functions for WASM bindings
Structs§
- Performance
Timer - Performance timing utilities for benchmarking WASM operations
Functions§
- capabilities
- Get system capabilities and features available in this build
- has_
simd_ support - Check if WASM SIMD is supported in the current environment
- init
- Initialize the WASM module with panic hooks and logging
- log
- Log a message to the browser console
- memory_
usage - Memory usage information for the WASM module
- version
- Get the version of SciRS2-WASM