News for hackers. Stuff that matters.
Re:Error stack traces in Go with x/xerror by atomicity on Monday August 23, 2021 @11:20PM (#28284753)
Except that people are too lazy to use exceptions that are checked at compile time.

The main benefit of Go is that the people that defined the library ecosystem actually decided to handle errors. It's the bare minimum, but it's better than just forgetting that the error exists and not documenting it either.

The language is ... not the best, but the libraries tend to be more robust.

Re:Error stack traces in Go with x/xerror by tsimionescu on Tuesday August 24, 2021 @05:56AM (#28286791)
Libraries can almost never handle errors - they can only signal them. And Go libraries are particularly bad at this, because they almost always return error strings, instead of meaningful error types, which means you can't easily handle a subset of errors. Even if you did, Go's errors suffer from the same problems as exceptions in many languages: there is no way to document what errors your function can actually return, just that it returns some error.

What language are you thinking of when saying Go libraries do better at error handling?

Re:Error stack traces in Go with x/xerror by erik_seaberg on Tuesday August 24, 2021 @01:59AM (#28285566)
It’s not always laziness, in Java

  stream.map(f)
doesn’t allow f to declare any checked exceptions. We could catch and wrap everything but that obscures the useful code without any improvement in safety.