4 ms·
Does the Haskell compiler spit out useful concise, meaningful error messages? Compilers often have some pretty verbose output for what ended up being a (relati
by PopeDotNinja 7y ago
Does the Haskell compiler spit out useful concise, meaningful error messages? Compilers often have some pretty verbose output for what ended up being a (relatively insignificant feeling) typo.
- philzook 7y agoIt depends. After having gotten used to it, I can usually barely glance at an error and figure it out. I am basically satisfied with ghc errors messages, although they could be better. Sometimes it takes real head scratching. I think languages like Haskell give the compiler enough information to make insanely good error messages (At compile time mind you! Unlike python/javascript/etc). Elm apparently has some of the greatest error messages in the world. I think it is significantly better than C++ errors.
- deleted 7y ago[deleted]
- viraptor 7y agoIt's trying hard - usually it's really nice. But sometimes the amount of signature inference kills the meaning. Most of the time you get an error like A is wrong because B that comes from C. And a lot of the time it's immediately clear what the problem is. But sometimes I either don't know why would B ever get the signature it did, or why would C ever be relevant for this piece of code.
- chongli 7y agoHaskell's compiler messages can be daunting for beginners but in the hands of an experienced user they can act like a surgeon's assistant, putting the right tool in your hand without you having to go and find it. This is the magic of types and features like typed holes, for which the compiler will suggest things in scope that will fit! Haskell programming at its best starts to feel like you're putting together a jigsaw puzzle, and everything "just works" once you get it to compile.