Live data from Hacker News

Rust as a gateway drug to Haskell

xion.io

51–60 of 218 posts

Re: Rust as a gateway drug to Haskell

#51
post #18

Earlier quoted context omitted.

Hence a reason why so many people are sticking to ML despite the lack of social momentum.

ocaml is a great language in its own right too; the only haskell features I find myself really missing are do notation and operator overloading.

Also the multicore concurrency.

Re: Rust as a gateway drug to Haskell

#53

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…

Haskell and Clojure are two languages I really hope I never have to program in. Seriously fuck them. I will program in the worst languages if only to just not be associated with those people. I have written a few small programs in Rust, but if it attracts the same kind of people, I'll happily move away.

Re: Rust as a gateway drug to Haskell

#54
post #36
post #23

Earlier quoted context omitted.

Haskell definitely allows imperative programming, it's just not particularly good at it.

What is it lacking for imperative programming? I find it to be immensely good at it!

I tried implementing some simple imperative algorithms (like union-find) and found the Haskell code very noisy. For example, "var x = f(y)" in an imperative language might translate to "let x = f y" or "do x <- f y" in a Haskell do block, and the wrong variant won't compile. There's no general purpose idiom you can use to replace all loops, only tons of special purpose HOFs you must memorize. Writing code that mixes different types of side-effecting calls is combinator hell. And so on. Usually an imperative algorithm will be much clearer in an imperative language than in Haskell, and easier to get right on the first try.

Re: Rust as a gateway drug to Haskell

#55

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.

[deleted]

Re: Rust as a gateway drug to Haskell

#59
post #23

Rust still allows imperative programming whereas Haskell doesn't. This makes a big difference. Rust is closer to Alan Turing than it is to Alonzo Church.

Haskell definitely allows imperative programming, it's just not particularly good at it.

"Haskell is, in my view, the world’s best imperative programming language, and second-best functional language" - Robert Harper (https://existentialtype.wordpress.com/2011/04/09/persistence...)
Post reply on HN