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

IMHO TypeScript/Flow missing pieces are 1) runtime side of type system (match) and 2) expressions instead of statements. Those two things complete the type system reaping rewards from annotating code with types. Both TS and Flow have reservations on adding those constructs to the language as it requires runtime support (match) and would be seen as too far departure from js (changing statement -> expression semantics).

The unwritten motto of TS/Flow is "stripe type annotations and you've got vanilla js". Adding support for match and expressions would mean adding runtime dependency and transformations which would violate this 1-1 symmetry.

This is a shame because type annotations are the hard/boring/sacrifice part, runtime matching is easy/fun/benefit out of it and expressions are just... I don't have words... - why would you think of making any of those statements? It's just pure limitation, adding verbosity, without any reason.




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

Search: