Something that I found about going from Haskell to Rust was that Rust provides many powerful abstractions without compromising on performance. It was very frustrating to try reasoning about performance in Haskell due to its laziness. Every language has quirks about how to write performant code, but Haskell is notorious in my mind for being quite easy to write obscenely slow code in.
Haskell/GHC will soon have an extension for linear types, which will bring the languages much closer: <a href="http://blog.tweag.io/posts/2017-03-13-linear-types.html" rel="nofollow">http://blog.tweag.io/posts/2017-03-13-linear-types.html</a>
The similarities are striking. Both have a problem with undocumented or experimental modules for everyday tasks, both use compiler plugins to make sure that every package is using its own superset of the language (although in Rust this only applies to nightly), both tout lofty goals while rarely producing production grade systems. Rust is the first toe dip into the world of blog posts heralding the"coming of the age of reason" when we all see the error of our ways for writing dangling pointer references and impure functions. To be a complete cynic, I hope Rust runs right away from over generalized abstractions and the Haskell indifference to achieving real success by overcomplicting even the most mundane of problems.
I wonder if Idris could some day take Haskell's place. It sports default eager evaluation. Seems like the tooling (package managers etc.) isn't quite there yet, though.
Isn't the most significant line: "For work-related reasons, I had to recently get up to speed on programming in Haskell"?<p>I was somewhat disappointed not to have a followup to what work-related reasons there might be. Note also that the About page says "work at Facebook".
I have heard the same thing about Kotlin now - <a href="https://hackernoon.com/kotlin-functors-applicatives-and-monads-in-pictures-part-1-3-c47a1b1ce251" rel="nofollow">https://hackernoon.com/kotlin-functors-applicatives-and-mona...</a>
I have found them to be very similar too. I started learning Haskell in earnest last September, following along with the exceptional "Haskell: First Principles" which I highly recommend. I had been toying with Rust around this time and I found a confluence of ideas between the two languages. Most things I learned in Haskell I was able to carry over to Rust.<p>The inverse was not quite as true. But I still love Rust. Any time I need something performant, or I just want to play around, it's my first choice.
The article references using trait objects for dynamic dispatch. FWIW, I found them extremely limited: you can't use generics, can't return Self... I wonder how often people use them.
> More advanced type systems, however, allow to specify the generic constraints explicitly.<p>Well, Java allows it, even if it looks a bit unglier than the Rust example.<p><pre><code> <T extends Comparable<T>> T min (T a, T b) {
if (a.compareTo(b) > 0) { return b; } else { return a; }
}
</code></pre>
And even without general availability of concepts (already in gcc 6.x), one can achieve it in C++ via <i>if constrexpr</i>.
Rust still allows imperative programming whereas Haskell doesn't. This makes a big difference.<p>Rust is closer to Alan Turing than it is to Alonzo Church.