5 ms·
I'm a long-time C++ programmer, and I set out to learn Haskell at one point. I didn't really 'finish', but everything I learned tended to make me think, "Ok, so
by benched 13y ago
I'm a long-time C++ programmer, and I set out to learn Haskell at one point. I didn't really 'finish', but everything I learned tended to make me think, "Ok, so it's like having a library full of algorithms that let you do useful work on data in a standard way." In other words, each "paradigm shattering" language feature, I saw as a big C function that you just don't see, because it's part of the language. But underneath, I know there's still the equivalent of a cool library, just in the runtime.
- falconfunction 13y agorule 1: don't talk about the runtime
- wting 13y agoI think that's an overly simplistic view of Haskell's feature set. For example, garbage collection can be thought as a "big C function implemented as a library." C++'s smart pointers and templates can be thought as libraries, but that doesn't detract from their value as programming language features. Your argument is a derivative of "in the end everything is glorified assembly."
- mightybyte 13y agoIt's so much more than just "a big C function". In my mind Haskell is not about being a big library of useful functionality, but rather a lot more about getting guarantees about the things your code can and cannot do. Haskell lets me guarantee that the function `fst :: (a, b) -> a` cannot possibly be buggy (barring things like unsafePerformIO/undefined which can be statically checked for very easily with things like Safe Haskell). It lets me guarantee that some functions will always return the same result given the same inputs. You simply cannot get these guarantees in C/C++.