4 ms·
I'm not sure your example makes sense. `a b c` means `a(b, c)`. MLs just leaves out the parens. You can't know just form looking at `a b c` what `b` and `c` a
by still_grokking 3y ago
I'm not sure your example makes sense.
`a b c` means `a(b, c)`. MLs just leaves out the parens.
You can't know just form looking at `a b c` what `b` and `c` are. They may be functions of course. But also any other value.
This would be exactly the same in for example JS. Nobody in JS ever complained that you can pass functions as arguments to functions and "don't see the arguments". (If you would write arguments you would actually call the function, and not pass it as a value.)
But in OCaml you have a static type-system that can tell you at any point what `a`, `b`, or `c` are! Just hover the symbol.
> I think the strength of ML and Haskell got eroded as more "mainstream"y languages got decent type systems (TS/Flow, Hack, Kotlin, even Rust, Python is getting there).
I don't think so. Especially given those examples.
TS/Flow doesn't have a sound type system. It may "type-check" fine and than explode at runtime. That's imho worse than dynamic typing as with dynamic typing you know at least that such fuck-up will happen. But TS delivers a false feeling of security about type safety where there is none.
Hack is "gradually typed" which is just another word for dynamically typed with some static checks. So not even close to MLs.
Python is also still dynamically typed, and that won't change. The bolted on type-checkers are unsound. So same situation as with TS.
Nothing can be said about Kotlin afaik, as there was no formal work on its type-system.
And Rust? Rust is a ML (with ugly C syntax)! So Rust is a prime example of how MLs are still one of the most modern and influential language designs to this day on.
With Rust and Scala you have even two MLs in the Top20 languages. If something than ML is slowly but finally approaching mainstream. Maybe not in its original form but still the tradition lives on.
- xixixao 3y agoI agree with you on TS being unsound. Flow on the other hand strove for soundness, as does Hack. Unfortunately TS dominated thanks to good strategy and some better ergonomics for open source (which were not a focus for FB). Rust is more ML than Flow or Hack because of traits (type classes? Not sure what ML calls them or if it even has them, Haskell does). But it’s a vastly different language otherwise, so I think the “other languages have learned from ML” is more accurate description of what’s happened. Some people write JS/TS in the ML style (point-free), but it’s not by far the most popular way. TC-39 came around to Hack-style pipelines for the same reason. For me the stylistic difference is a crucial indicator of preferences and priorities. Haskell’s operator “overuse” lives in a similar world.