Is Typescript as close you get to Ocaml world... without writing a "ml" ?
Is Typescript as close you get to Ocaml world... without writing a "ml" ?
Clean or Purescript or Haskell or Rust would be the closest you can get to the OCaml world without writing the word ML.
I still call it reason, especially when I talk about it with other js developers ;)
Typescript is unrelated to OCaml in any way.
I'd say the link between TypeScript and F# is the pragmatic approach that Microsoft took. Different paradigms but with the same care for usability. They are both great language for projects.
Flow has a quite powerful type system that mimicks (and is inspired by) OCaml. Flow itself is written in Ocaml, by Facebook.
But on the other hand, C# is more like Java (with extras) than JavaScript, haha.
This trade off is good because there is no runtime overhead, only desugaring. Typescript should never become ML or anything else that Javascript is not. If you want pattern matching in Typescript you need to convince the Ecma committee to put pattern matching into Javascript first.
What I don't see is how this requires the addition of a "runtime" on top of the JS model to make it work. I don't use TypeScript, and don't know how it implements its data types, so there may be something obvious here that I'm missing.
But it could use JavaScripts own types.
But it couldn't use TypeScripts types.