Hacker News new | ask | show | jobs
by ac 4686 days ago
>> I'm kind of shocked there hasn't been a horrified response from HN Haskell fans.

"What an ignorant fool?! How could he abandon the holy grail of Haskell?!" -- like that? :)

For someone who wrote a lot of compiler and program analysis code in Haskell I can hardly imagine myself writing the same in C++. That said, I can totally understand the author's perspective. As the author writes, "I really wanted to like Haskell. [...] But when it comes down to it, I am an object-oriented programmer, and Haskell is not an object-oriented language." And I think that's the core of his troubles. I can imagine it's hard to write Haskell with an OOP mindset and expect it to be easy. I'm not saying pure functional programming is superior to imperative object-oriented programming -- they are just different and require different mindsets. Before I learned Haskell in the university the only language I had done any substantial amount of programming in was C++. And I had to make quite a switch in how I think of algorithms. I remember a lot of my classmates struggled with writing even the simplest programs in Haskell. But after some time I've really started understanding the Haskell way of thinking and, to me, it's easier to program in this language than in C++ which I regard as unnecessarily verbose and baroque.

Personally, I wouldn't even think about writing a compiler in C++ unless I was feeling masochistic. That said, I have never written a compiler in C++. So, should my experience in writing compilers in C++ have been greater and my experience with Haskell lower, it would have made sense for me to use the tool I knew how to use best (C++). Since I don't know how to write a correct compiler in C++ as fast as in Haskell, the only feeling I can express towards the author is pure and unadulterated awe.

PS: On that note, I've been shocked to discover that a horrified response from Haskell fans is expected. Haskell community is one of the friendliest and non-opinionated I've known, so I wonder why Haskellers are perceived as being akin to closet trolls.

2 comments

FWIW, C++11 has massively improved the verbosity problem in C++, by introducing much more powerful metaprogramming features that make it possible to build more concise tools. As an example, I talk a bit in the article about how I've implemented parser combinators. They're not quite as concise as Haskell's, but they're a whole lot better than what you could do in C++03.

The down side is that taking full advantage of metaprogramming in C++11 requires learning a very large and complicated language. But once you've done that, it's really not so bad.

I agree, that the Haskell community is generally awesome. There are just a number of vocal trolls that tend to frequent HN.
There are?