4 ms·
After learning Haskell, I found its approach to solving problems much simpler. I will admit that it was very unusual at first. Lens, monads, template Haskell, a
by 58028641 10y ago
After learning Haskell, I found its approach to solving problems much simpler. I will admit that it was very unusual at first. Lens, monads, template Haskell, and a very powerful types system are the key features that make it standout.
- acchow 10y agoIMO, if you just use C++ without subtyping (no inheritance) and only immutable structures, you get most of the "simplicity" of Haskell. And with C++17 variant, you also almost get pattern matching. (also, as per "powerful type system", you can do dependent types in C++)
- wyager 10y ago> if you just use C++ ... and only immutable structures, you get most of the "simplicity" of Haskell. Huh? I cannot relate to this statement at all. C++'s memory model is not friendly for immutable structures. The semantics of C++ are also substantially more complicated than those of Haskell. Although Haskell has some fairly powerful type-level machinery (if you choose to use it, which you needn't), the value-level semantics are extremely simple across the board. Essentially everything in the entire language is just straightforward syntactic sugar over lambda abstraction/application and constructor application/matching. It gets more complicated (like C++) for high-performance library authors who need to peek under the hood at low-level memory operations, but 99% of users are insulated from that.
- eklavya 10y agoEither that statement is incorrect or I am misunderstanding one of C++ or Haskell very wildly.
- PeCaN 10y agoIf you just use C++ without $SOMETHING and $OTHER_THING, you get most of the $APPEAL of $LANGUAGE.
- lmm 10y agoSimplicity can never happen without enforcement. If there is no way to automatically enforce the use of this simple subset of C++ then it's impossible to use it on a real project where you have more than 1 developer. A lot of people seem to think it's a trivial, handwavable exercise to come up with this subset - but no-one has ever managed to actually do it. http://robert.ocallahan.org/2016/06/safe-c-subset-is-vapourware.html http://robert.ocallahan.org/2016/06/safe-c-subset-is-vapourw...
- AnimalMuppet 10y agoIs that a plus or a minus? If you're not a purity zealot, then you can step out of those rules where it makes sense, and regard the ability to do so as a plus. If you are a purity zealot, you're appalled at the thought, and want to force people not to do that.
- lmm 10y agoI'm not a purity zealot, I'm a correctness zealot. Working on real projects means working with people who are less competent than they think they are; I want to force those people to not introduce bugs, and I'm broadly indifferent to the mechanism for doing that.