News for hackers. Stuff that matters.
Re:New in Go 1.20: wrapping multiple errors by lelanthran on Sunday December 11, 2022 @09:41AM (#33943599)
> Rust doesn't have nil/null values.

Yeah, and it's also not popular. The reason I said "popular" is because the popular languages are addressing pain-points for devs.

If nil/null was a pain point, none of the popular languages would allow nil/null values.

The simple fact is that, for many developers, there is a pressing need to indicate lack of a value. Languages that don't address this pain-point never really get taken up en masse.

Re:New in Go 1.20: wrapping multiple errors by the_duke on Sunday December 11, 2022 @10:18AM (#33943869)
"Old language have it, so it must not be a problem" is not a very convincing argument.

Almost every new language that has come out in the last ~10 years or so tries hard to avoid null pointers, and old languages try very hard to mitigate the problem in various ways.

Dart went through a tedious process of removing nullability.

Kotlin doesn't have nullability (well, sort of, using Java bindings can still get you null pointer exceptions).

There are lot's of attempts for Java, from static analysis tools (eg recently from Meta , but there are older solutions), Springs new @NonNull, etc.

C# switched to making non-nullable the default a few years ago.

Rust only has null pointers in the unsafe part of the language, and only for low level raw pointers, not for traits.

Go is the odd one out.

Re:New in Go 1.20: wrapping multiple errors by lelanthran on Tuesday December 13, 2022 @07:14AM (#33967853)
> "Old language have it, so it must not be a problem" is not a very convincing argument.

That strawman is not the argument. The argument is that "popular languages have it, so it must be solving some problem".

You can say what you like about popularity, but it still remains a good indicator of what works in practice and what doesn't, especially when the alternatives are all well-known and have been around for decades.

Re:New in Go 1.20: wrapping multiple errors by ghqst on Sunday December 11, 2022 @10:03AM (#33943761)
I don't think anyone gets to say that Rust isn't popular anymore. Especially considering it's now in the Linux kernel.
Re:New in Go 1.20: wrapping multiple errors by lelanthran on Tuesday December 13, 2022 @07:15AM (#33967861)
> I don't think anyone gets to say that Rust isn't popular anymore. Especially considering it's now in the Linux kernel.

Popular amongst Rust fans, certainly. Popular amongst employers, no. It's still barely a rounding error for employers.

Re:New in Go 1.20: wrapping multiple errors by hota_mazi on Sunday December 11, 2022 @11:56AM (#33944883)
And there are 1.5M lines of code of Rust in Android [1].

[1] https://www.theregister.com/2022/12/02/android_google_rust/

Re:New in Go 1.20: wrapping multiple errors by cesarb on Sunday December 11, 2022 @10:37AM (#33944028)
Playing devil's advocate: what's now in the Linux kernel is the infrastructure to allow writing code in Rust, but AFAIK for now nothing uses it (there's Asahi Lina's Rust driver for the Apple M1/M2 GPU, but it's still out-of-tree).

I find it likely that Rust in the Linux kernel will not be used for anything important (other than architecture-specific code) until either it can be compiled using GCC (either the GCC backend for the Rust compiler, or the Rust frontend for the GCC compiler), or the LLVM backend supports every single architecture supported by the Linux kernel (or the Linux kernel loses support for the architectures the LLVM backend doesn't support).

Re:New in Go 1.20: wrapping multiple errors by pjmlp on Sunday December 11, 2022 @01:09PM (#33945656)
Android fork of Linux kernel uses it. Bluetooth stack was rewritten in Rust for Android 12, and the new virtualization stack in Android 13 is based in crosvm, also a Rust.