News for hackers. Stuff that matters.
Re:Practical nil panic detection for Go by eviks on Saturday November 18, 2023 @01:44PM (#38322922)
It's also worth reading the examples you post

Like, one of the first files has only .unwraps in the comments (like a dozen of them in a file), some are infallible uses, some are irrelevant-to-runtime tooling, etc.

But anyway, "some" is a lot smaller than "all". Just like some of memory safety issues would also have happened since you can still use unsafe in Rust, yet it's still a big step forward in reducing those issues in the ugly real world

Re:Practical nil panic detection for Go by foldr on Saturday November 18, 2023 @02:15PM (#38323244)
It's a list of all instances of ".unwrap()" in the project, so of course it includes instances irrelevant to my point. Seems uncharitable to assume that I haven't looked through it on that basis.
Re:Practical nil panic detection for Go by shakow on Saturday November 18, 2023 @02:31PM (#38323434)
Then please pinpoint some problematic ones, so that not every reader has to delve into pages to continue the discussion.
Re:Practical nil panic detection for Go by foldr on Saturday November 18, 2023 @03:55PM (#38324313)
The point is precisely that it's not always easy to figure out which instances are problematic.

If you think about it a bit, given that bugs are relatively rare in a mature project, it's going to be difficult to find a use of unwrap that's definitely bad.

Re:Practical nil panic detection for Go by eviks on Saturday November 18, 2023 @11:35PM (#38329009)
My basis is the %, not the simple fact that it has irrelevant instances.

So let me charitably ask directly: have you looked through all the examples at least on the first couple of pages? And if you have, what % of instances is relevant to your point?

Re:Practical nil panic detection for Go by foldr on Sunday November 19, 2023 @02:56AM (#38330263)
I think this is covered in my reply to shakow. Unless Rust is absolutely riddled with bugs, it’s obviously going to be hard to find uses of unwrap that are definitely bad. The point is that there’s no way to easily assure yourself that all the uses of unwrap are definitely good.

It would be similarly difficult to trawl through the source of the Go compiler and find definitely bad instances of pointer dereferencing. So does that mean that it’s not actually a problem in Go either?