Hacker News new | past | comments | ask | show | jobs | submit login

Interestingly TypeScript compiler doesn't use types for compilation (that's why you can have esbuild that compiles Typescript without understanding the type system). That is the end result of type computation is... Nothing, always, just like in OP.

Template metaprogramming is all about code generation. You would expect them to look different.




The way I think about this is that type computations can be used both for type constraint checking and for code generation. In that sense, C++s template metaprogramming system is a superset of TypeScript's, which can only do checks as you pointed out correctly.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: