3 ms·
There are type systems that don't have anything like "any" - you find that in languages like OCaml or Haskell. But in TS, the main reason for "any" is interop
by int_19h 8y ago
There are type systems that don't have anything like "any" - you find that in languages like OCaml or Haskell.
But in TS, the main reason for "any" is interop with JS.
- linkmotif 8y agoThanks. So in OCaml/Haskell you can write perfectly sound programs?
- int_19h 8y agoWell, I mean, you can write perfectly sound programs in Java as well, or in TS. It's rather a question of how hard/easy it is to do so. Technically, any language that has either direct memory manipulation or FFI has the potential to do unsound things about types, but it takes a lot more effort.
- chowells 8y agoHaskell's type system still isn't sound. It just elimates that particular class of errors. A lack of soundness is closely related to the Turing completeness, especially in languages based on HM. In an ideal world you would want a sound type system and not want Turing completeness, but the tooling doesn't exist to make those choices the most pragmatic right now.