2 ms·
Well, all languages translate to machine code eventually, but that doesn't make all languages equally easy to understand. Specifically, some people try to unde
by cousin_it 12y ago
Well, all languages translate to machine code eventually, but that doesn't make all languages equally easy to understand.
Specifically, some people try to understand code by mentally stepping through it. IMO that's a lot easier in imperative languages than in Haskell. In imperative languages, you step down one line at a time, and loop back in easily specified places. In Haskell, on the other hand, you need to imagine graph reduction in your head. That's already pretty hard for most people, but it gets worse! You can't mentally step through a Haskell function in isolation, because the sequence of graph reduction steps depends on what the caller will do with the answer.
That's not just a theoretical difficulty. Take a look at this thread: http://lambda-the-ultimate.org/node/3127 http://lambda-the-ultimate.org/node/3127. A bunch of programming language researchers and long-time functional programmers are looking at a six-line Haskell program implementing the Sieve of Eratosthenes, and cannot figure out its big-O complexity. I can't, either.
- tome 12y agoMaybe I am splitting hairs then. I still hold that the translation is fairly simple. On the other hand, the operational steps that the machine code goes through can be mind bending, and I still have trouble figuring it out myself. Perhaps that's what raverbashing meant all along.