Hacker News new | ask | show | jobs
by astrange 636 days ago
I can think of a few others where you have to do that; most of them are the kind of languages whose fans say they're impossible to write bugs in.
2 comments

Rust is hard but I've never had the compiler just throw up its hands and tell me it's up to me to figure out what's wrong.
That's not the one I was thinking of.

https://anthony.noided.media/blog/haskell/programming/2020/0...

Something like Idris or Coq would have even more complex messages, though I don't have an example on hand.

Ok but these are mainly academic research languages. Swift has the backing of the most valuable company in the world and is what they're pushing as the right way to develop for their platform.
Haskell is definitely a real industrial language!

Many of the other languages in the formally verified/dependent type space are academic, but there's government interest in things like Ada too because they don't want their planes to crash. Couldn't say how good its error messages are though.

I've seriously used Erlang for a while, and Haskell looks kinda similar. Ingenious ideas there, cool features, but in the end it's cumbersome to use. So I can see why these are niche and wouldn't consider them next to big ones like Swift or C++.
If Rust is one, yeah I have to fight that compiler but it's because it's doing its job and not letting me do invalid things. Not because the compiler has some feature "not yet implemented" or has bugs.
Also, is anyone familiar with the weirdness with tuples in Swift? All I remember is they never worked the way I expected, and for some reason something in our code specifically worked for tuples up to size 5.
Swift only got variadic generics fairly recently, and before that you couldn’t write code which was generic over tuple size. Instead you had to codegen versions for each size of tuple you needed to support.
I think that was it. There was also something about tuples inside of dictionaries that Swift 1 or 2's compiler segfaulted on.