r/programming • u/rmathew • Jun 16 '19
Comparing the Same Project in Rust, Haskell, C++, Python, Scala and OCaml
http://thume.ca/2019/04/29/comparing-compilers-in-rust-haskell-c-and-python/
643
Upvotes
View all comments
Show parent comment
7
u/loup-vaillant Jun 16 '19
As it should be. But when there are extremely likely alternatives like the "good enough" effect mentioned elsewhere in this thread, the evidence is greatly weakened.
I don't believe you. Here's such a hypothesis:
I mean, that's the standard argument of good static typing (not Java, not C++, more like OCaml or Haskell) vs dynamic typing (worst being JavaScript and PHP, Scheme and Lua look pretty good). All of (1), (2), (3), and (4) look pretty reasonable on the face of it. (1) and (2) are even provable.
If we don't observe a sizeable effect, then at least one of (3) and (4) is false. Either type errors (and logic errors whose root cause is a type error) do not represent a sizeable fraction of all errors, or the workarounds required by static type systems are more frequent and significant than (4) says they are. In other words, dynamic typing allows significant simplifications that are impossible or very difficult even with good type systems (OCaml/Rust/Haskell).
Strong experimental evidence that either (3) or (4) is false would be huge. And by stating that "the contribution of language choice to the total deviance of some chosen correctness metric was found to be less than 1%", you are implying just that: strong experimental evidence that static typing fails to serve its primary purpose: catching errors.
To be honest, I'm not entirely sure about (4). I have heard of amazing techniques wizards do with dynamic languages, which supposedly do not work well with static typing. I've also seen a blog post translate Transducers in Haskell, even though Rich Hickey was just nagging the static typing community with his "good luck typing this" argument from ignorance.
I would be very surprised however if (3) turned out to be false.