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

Image of Stellar post

Check out Episode 1: How a Hackathon Project Became a Web3 Startup 🚀

Ever wondered what it takes to build a web3 startup from scratch? In the Stellar Dev Diaries series, we follow the journey of a team of developers building on the Stellar Network as they go from hackathon win to getting funded and launching on mainnet.

Read more

Top comments (0)

Image of Stellar post

How a Hackathon Win Led to My Startup Getting Funded

In this episode, you'll see:

  • The hackathon wins that sparked the journey.
  • The moment José and Joseph decided to go all-in.
  • Building a working prototype on Stellar.
  • Using the PassKeys feature of Soroban.
  • Getting funded via the Stellar Community Fund.

Watch the video 🎥

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay