Re:Try OCaml
by gmfawcett on Friday September 07, 2018 @08:45AM
(#17933800)
Your comment seems like a non-sequitur. What does pattern matching have to do with runtimes?
[ Parent
| on HN ]
Isn't one part of pattern matching to ask for a type and the other to ask which values the (instance?) of that type holds?
When a language has algebraic data types -- i.e., data types that have multiple, disjoint constructors -- pattern matching generally means determining which constructor was used to create the value being matched, and branching on that. I'm guessing this is the kind of pattern-match that TypeScript users would be eager to have.
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.