DEV Community

John B
John B

Posted on

Numerical Library in Typescript

I recently discovered typescript after working a lot with Scala, Python and JS. I found it to be the perfect compromise between heavy statically typed languages like Scala and convenient, fast but dynamically typed languages like JS.

Typescript is a superset of Javascript and what makes it very appealing to me is that its community is growing and big players (Microsoft) are strongly supporting it (Visual Studio Code, etc).

Something that is less spoken of but that I find very interesting and promising is that it could potentially compile to other languages (see for instance https://github.com/AssemblyScript/assemblyscript, even if technically it is not typescript).

At the light of the above I was interested to see if there was a simple numerical library that would allow me to do basic Linear algebra, some statistics, etc. (a Python Numpy equivalent I guess). And while there are a few libraries, most of them are actually JS libraries that were then made compatible for TS.

So in these days of confinement, I thought I would give it a go.

The library now exists:
https://github.com/Nexysweb/math-ts
https://www.npmjs.com/package/@nexys/math-ts

It covers most of the math stuff that I need for most projects, for example, in no particular order:
Math:

  • linear algebra
  • complex numbers
  • numerical integration
  • series

Stat:

  • regression
  • anova

Finance:

  • mortgage calculation

I would be more than happy to get feedbacks, or better, PRs...!

Top comments (0)