DEV Community

Cover image for [TSTL] Migration from C++ STL to TypeScript (open source failure stories)
Jeongho Nam
Jeongho Nam

Posted on • Updated on

[TSTL] Migration from C++ STL to TypeScript (open source failure stories)

Series of Open Source Failure Stories

  1. TSTL
  2. TGrid
  3. Cagen
  4. Safe-TypeORM

Outline

In previous 2022, I had introduced my open source library typia here at dev.to, and thanks to your explosive responses, I was selected as "2022 top author" and received a gift. Also, I could get received a large number of stars from you.

In today, I'd like to introduce my other open source projects, that has been failed over 10 years. From those failure stories, I want to share my experiences and lessons learned from them.

Image description

Present from dev.to for being selected as "2022 top author"

TypeScript-STL

https://github.com/samchon/tstl

TSTL is a migration project from C++ STL (Standard Template Library) to TypeScript.

  • Containers
    • Vector, Deque, ForwardList, List
    • HashSet, TreeSet, FlatSet
      • HashMultiSet, TreeMultiSet, FlagMultiSet
    • HashMa, TreeMap, FlatMap
      • HashMultiMap, TreeMultiMap, FlatMultiMap
  • Iterators
  • Threads(?)
    • Barrier, ConditionVariable, Latch, Semaphore
    • Mutex, TimedMutex, SharedMutex, SharedTimedMutex
    • Singleton, VariadicSingleton, MutableSingleton, VariadicMutableSingleton
  • Utilities
    • <algorithm>
    • <functional>
    • <numeric>
    • <special_math>
    • <ranges>
    • <utility>

I'd developed this library to study data structures when I was a college student. In addition, since the basic containers of JavaScript are extremely weak, there was also an expectation that if I can implement every STL containers in the TypeScript, maybe I can become a famous open sorce library developer in short time.

After graduation, I became an algorithm developer, and kept using it for few years in a new reason. I often made a prototype project on the Web (TypeScript + React) and then completing the optimization logic, migrated the prototype to C++ production. Such migration was quite convenient because the same interface was guaranteed at the base library level through TSTL.

In summary, I had started TSTL to learn data structures, but I had been continuously working on the TSTL project, whether it is to become famous as an open source library or for convenient migration. Its duration was about 8 years.

Image description

Utilized TypeScript for fast prototyping and demonstration

Problems

However, have you heard this TSTL library? Maybe not. It is never a famous open source library and most of TypeScript developers do not know and do not use this TSTL library. During the long time development, I'd noticed my immaturities and understood why TSTL couldn't be famous.

Key reason of the failure was on appropriateness. Interface of STL components are enough suitable in C++ environments, however, it was not suitable for TypeScript development. The idea of making prototypes and demos of algorithms with TypeScript seems to have been a thought only to me. In normal frontend (and sometimes backend) development, TreeMultiMap or <special_math> functions are not needed. Why <thread> like components (ex. ConditionVariable) would be required in common JavaScript environments?

Another reason is, TSTL was an overly large project for an open source novice developer to make. Open source project never ends up with main program implementation. Lots of extra skills like documentation or PR powers are required. And I never had experienced such documentation and PR processes. Now that I think about it, shouldn't the first open source project had to start from a smaller one?

The last reason may be I had not known famous developer communities like this dev.to. I hand't known how to advertise and introduce my open source projects to massive developers.

Top comments (0)