News for hackers. Stuff that matters.
Re:Go vs. Rust: Writing a CLI Tool by c-cube on Tuesday August 04, 2020 @01:06AM (#24046828)
Rust is a bit safer.

- it warns you if you ignore an error. - it forces variables and fields to be initialized. - it has sum types and generics instead of interface{}. - it prevents some race conditions at compile time. - it pushes programmers towards immutability.

Re:Go vs. Rust: Writing a CLI Tool by pkolaczk on Tuesday August 04, 2020 @01:14AM (#24046869)
It doesn't only WARN about ignoring an error, it refuses to compile. T and Result<T, E> are different types.
Re:Go vs. Rust: Writing a CLI Tool by kd5bjo on Tuesday August 04, 2020 @07:16AM (#24048783)
The warning comes if you try to call a function for its side effects and ignore the return value. In most cases it’s fine, but ignoring a Result or a Future will issue a warning.
Re:Go vs. Rust: Writing a CLI Tool by saturn_vk on Tuesday August 04, 2020 @10:31AM (#24050348)
I've always wondered whether "unwrap"-ing is considered ignoring? I personally always equated it to ignoring if there's an error
Re:Go vs. Rust: Writing a CLI Tool by steveklabnik on Tuesday August 04, 2020 @10:40AM (#24050450)
I would say no, because it's not ignored. It makes it explode.
Re:Go vs. Rust: Writing a CLI Tool by wwright on Tuesday August 04, 2020 @07:50AM (#24048993)
They also try to have aggressive defaults on integer wrapping and so on. I work with a junior who is writing a Go program who would have benefited from the early detection ;)