DEV Community

John B
John B

Posted on

4 2

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...!

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay