Hacker News new | ask | show | jobs
by _bxg1 2205 days ago
a) Any static type system has things that it can't express elegantly or maybe at all. In my experience, the more "meta" your project is, the more you're going to run up against these bounds. So it makes sense that this could be the wrong use-case for TypeScript.

b) There is a valid, broader point to be made here that while TypeScript itself doesn't carry any runtime overhead (by design), it can in some cases force you to contort your code, so that it can be type-verified, in ways that have a runtime impact. In my experience (a couple of years writing TypeScript professionally) this is uncommon and not a huge problem, but does happen occasionally. It's also worth noting that the vast majority of these cases can be papered-over using //@ts-ignore, "as" casting, etc. if necessary.