Typescript Math Toolkit Project 2.21.2016


I have some good news regarding what will be the biggest open-source project I’ve ever attempted.

I just finished a lucrative, short-term gig, so I have some spare time before I need to get back in the hunt for a new gig.  My current plan is to take a month off to work exclusively on the TSMT project and some Angular 2/Typescript demos.

The organization of the library will follow the same general layout as its predecessor, the Javascript Math Toolkit.  There will be some additional folders for A2 components and pipes.  There will be a streams folder for number sequences and interactive core methods that are well-suited for implementation as RxJs Observable streams.

I am currently working on converting the math package.  Conversion is more than just adding type descriptions to variables.  As I convert from JS to TS, I am also reviewing handling of edge cases and outliers.  Documentation is being overhauled as the library is intended for general distribution.

I took a lot of testing shortcuts in the JSMT since I originally intended it to be a private library.  I could get away with visual, interactive testing and not have to worry much about regression tests since I had in-depth knowledge of how modifying method A would affect other methods in other classes.

The TSMT will have an extensive set of unit tests (implemented with Jasmine).  A package.json file is supplied that allows anyone to quickly install test-framework dependencies.  There is a single specs file and an html file for testing each package.  Although I like karma and Phantom-JS as much as the next person, I also like to jump into the Chrome debugger whenever I hit a failed test.  A Jasmine-only test framework also keeps dependencies at a minimum.

There is a script to build all files in a package, build the test specs, and then execute the test specs.  For example,

npm run build-math-files

npm run build-math-test

npm run test-math

This builds and executes the entire test suite for everything in the math package.

Demos will be placed in a demos folder and most likely built with a packager (webpack, blah, blah) and gulp.  Demos will be visual and interactive as some portions of the library can not be adequately tested/demonstrated by any other means.

I still don’t have a timeline since I’m not an independently wealthy person.  Development is well underway and as you might guess, I’ve started with the math package.  Here is a screen shot of some of the specs for the cubic root finder and derivative approximation.


I will try to post updates at least once every 1-2 weeks or whenever there is something really interesting to report such as a demo preview.

And, yes, I suppose that means we will see an Angular 2 version of the infamous quaternion calculator in the near future :)

Comments are closed.