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

Your quarrel is not with JavaScript (as everyone else has pointed out, there’s no reason one can’t build a secure compile-time type system on top of JavaScript), but with some of the specific design decisions made by TypeScript that open soundness holes, such as “programmers are too stupid to understand the difference between covariance and contravariance, so we’ll pretend everything is bivariant”.

See https://www.typescriptlang.org/docs/handbook/type-compatibil... for a less cynical presentation of these design decisions.




This gives an explanation of why they made the choice: https://github.com/Microsoft/TypeScript/wiki/FAQ#why-are-fun...

Also, FWIW, in my experience, I don't think I've ever actually run into a problem with this in real code.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: