TSTL provides most features of STL like below:
Why I've made the TSTL?
In my case
I'm a programmer researching and optimizing algorithms. Most projects about algorithms have a special step; demonstration. In the step, do not consider production and optimization. Only possibility is considered and try to proof the possibility by visulation (demo).
For a such reason, I prefer to using easy script language and visualization tool, like
HTML, to demonstrate fast. Using the fast tools (
HTML), I've realized some weaknesses of those combination and decided to improve them by myself. It's the reason why I've started the project TSTL.
Deficits of JS Library
Within framework of containers, only
Object (dynamic object, it seems very dangerous) are provided. In nowadays,
Map have newly added. It had seemed like a good new for a while, however, they also make me feeling deficiency. They're too monotonous.
- When tree-based associative containers are required? then how to do?
- When key is not an atomic value like
string, but an object, then how to do?
- Specialization of hash function is required, then how to do?
- Sub-iteration is required, then how to do?
Functions are dificit, too. Base library of JS does not provide enough functions. It's possible to fill the dificit functions from lots of external libraries. However, in that case, I can't take any advantage of unified design and pattern. Without unified design and pattern, only spagetti code and vulnerable adaptors are left.
In such terrible environment, we can find a solution by turning away our eyes to STL (Standard Template Library). STL is defined by C++ Standard Committee. Their features have unified design and pattern that is clear and reasonable, because they've improved efficiency and unity for a decade years. If such STL features come into TypeScript, it sounds great, isn't it? That's the reason why I've been making and upgrading the TSTL.
For convenient migration
I repeat that, I'm a programmer researching and optimizing algorithms. I prefer implementing demonstration project by
HTML. After the demonstration, I'll migrate the program to
C++ considering optimization.
Migration means re-writing similar code from
C++. Re-writing those codes, haven't I felt inconvenient and anxiety of same designs & interfaces? How comfortable would it be if
C++ shares same design and interface in basic level? It's the secondary reason why I've built TSTL.