4 ms·
> 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 f
by lelanthran 4y ago
> 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.
- ghqst 4y agoI don't think anyone gets to say that Rust isn't popular anymore. Especially considering it's now in the Linux kernel.
- cesarb 4y agoPlaying 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).
- pjmlp 4y agoAndroid 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.
- hota_mazi 4y agoAnd there are 1.5M lines of code of Rust in Android [1]. [1] https://www.theregister.com/2022/12/02/android_google_rust/ https://www.theregister.com/2022/12/02/android_google_rust/
- lelanthran 4y ago> 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.
- the_duke 4y ago"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.
- lelanthran 4y ago> "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.