List view
Currently, TypeScript is used as parser and type checker for TS2C. However, TypeScript is very heavy and has a lot of features that TS2C will never need. TypeScript adds a substantial startup lag, which is especially annoying when using TS2C from command line. Compiling files one by one means loading the huge TypeScript dependency every time. And while TypeScript has pretty good incremental compilation features, but initial parsing is quite slow. TS2C has quite a lot of tests and running tests takes a lot of time. Most of this time is spent loading TypeScript... It would be quite beneficial from DX point of view to make tests run faster than right now. Another problem is using TypeScript in browser. Nowadays it weights over 3Mb minified, which is obviously not optimal. Yet another problem with TypeScript is that it doesn't provide a convenient API for AST manipulation. All of that makes me think of replacing TypeScript to a more lightweight parser. Kataw is one of the candidates: it's API is quite similar to TypeScript, it supports enough features for TS2C use case, and was built with performance and low memory footprint in mind. Current idea would be to patch kataw to make it compatible with TypeScript API, strip unneeded features. Besides TypeScript, TS2C itself has cyclic type inference mechanism, which is very slow. Instead, graph-based propagation mechanism could be implemented.
No due date•2/2 issues closed