Re:TypeScripts Type System Is Turing Complete
by lewisl9029 on Wednesday August 02, 2017 @03:05AM
(#14908537)
Hmm... did I somehow misinterpret this statement from the GP?
> The important distinction is that if you tell typescript a function can take in any value it makes no attempt to type check. Flow will look at each usage of the function and try to determine if the value being run through is valid.
This reads to me to mean that while annotations are optional in both systems, if you don't provide them for a particular subsystem in TypeScript, the static analysis will simply perform no checks for usages of that particular subsystem, while in Flow it will still attempt to validate your subsystem with properties it can infer on a best-effort basis from things like the way its functions are called.
Re:TypeScripts Type System Is Turing Complete
by Joeri on Wednesday August 02, 2017 @01:11PM
(#14912484)
Typescript also tries to infer types, and falls back to an implicit "any" type when it can't. Flow was better at type inference, but I don't know if it still is.
> The important distinction is that if you tell typescript a function can take in any value it makes no attempt to type check. Flow will look at each usage of the function and try to determine if the value being run through is valid.
This reads to me to mean that while annotations are optional in both systems, if you don't provide them for a particular subsystem in TypeScript, the static analysis will simply perform no checks for usages of that particular subsystem, while in Flow it will still attempt to validate your subsystem with properties it can infer on a best-effort basis from things like the way its functions are called.