stdlib
stdlib
Athan Reines | @kgryte | @stdlibjs

Math, Machine Learning, and JavaScript

Survey

Overview

     
  1. Big Picture
  2. Why JavaScript?
  3. State of JavaScript
  4. State of Ecosystem
  5. A Standard Library
  6. The Future

Big Picture

1. Edge Computing

2. Browser Virtual Machine

3. Modularity

4. Artificial Intelligence

5. Community

Always Bet on JavaScript

JavaScript

Language of the Web

 

MATLAB

R

 

Python

Mathematica

 

Julia

Why?

  • Dynamically compiled
  • U/Int64
  • BigInt/BigNumber
  • Single-threaded
  • C/C++/Fortran bindings
  • Performance
C R Python JavaScript
sin 35,054,483 281,001 5,838,843 9,598,538
expm1 40,191,109 274,317 6,161,389 9,139,959
erf 77,101,176 170,354 4,824,532 10,463,968

Community.

Libraries.

Why?

  • Web APIs
  • Rendering
  • Visualization/Computation
  • Ubiquity
  • Distribution
  • Package Management

Applications

  • Edge Computing
  • Cross-platform
  • Compute Intensive
  • Interactive Data Analysis
  • Integrated ML
  • AI Powered

Mad science.

State of Math in JavaScript

  • acos
  • asin
  • atan
  • atan2
  • cos
  • sin
  • tan
  • acosh
  • asinh
  • atanh
  • cosh
  • sinh
  • tanh
  • abs
  • exp
  • log (ln)
  • pow
  • sqrt
  • sign
  • cbrt
  • expm1
  • log10
  • log1p
  • log2
  • ceil
  • floor
  • round
  • fround
  • trunc
  • max
  • min
  • random
  • hypot
  • clz32
  • imul
  • No standard algorithms.
  • No minimum precision.
  • Portability.
  • No common codebase.
  • Slow pace of innovation.
  • Bugs.

Math.pow


var x = Math.pow( 10, 308 );
// returns:  1.0000000000000006e+308
// expected: 1.0e+308
				

Math.exp


var y = Math.exp( 100.0 );
// returns:  2.6881171418161485e+43
// expected: 2.6881171418161356e+43
				

What's being done?

Not much.

  • The fragmentation problem.
  • The portability problem.
  • The versioning problem.
  • The flexibility problem.
  • The backward compatibility problem.
  • The globals problem.
  • The testing problem.
  • The trust problem.

State of the Ecosystem

  • False assumptions.
  • Low hanging fruit.
  • Poor implementations.
  • Insufficient scope.
  • Lack of ambition.

A lot of noise.

1500+ Packages

stdlib
stdlib
stdlib
stdlib

A standard library.

stdlib

So what's needed?

Your help.

Thank you!

stdlib

https://github.com/stdlib-js/stdlib
https://www.patreon.com/athan

Appendix






















				

The End