Rust in the kernel is no longer experimental
561–570 of 853 posts
Re: Rust in the kernel is no longer experimental
#562Earlier quoted context omitted.
I prefer a billion dallars tax free, but here we are:(
In Rust dev, I haven't needed Valgrind or gdb in years, except some projects integrating C libraries. Probably kernel dev isn't as easy, but for application development Rust really shifts majority of problems from debugging to compile time.
Re: Rust in the kernel is no longer experimental
#563Re: Rust in the kernel is no longer experimental
#564Earlier quoted context omitted.
Without a very hard commitment that is going to be a huge hurdle to continued adoption, and kernel work is really the one place where rust has an actual place. Everywhere else you are most likely better off using either Go or Java.
Aren't large parts of a web browser and a runtime for a programming language also better written in Rust than in Go or Java?
Re: Rust in the kernel is no longer experimental
#565Earlier quoted context omitted.
>"Rust isn't unlike C either. You can write a lot of it in a pretty C like fashion." I think that with all of the Rust's borrowing rules the statement is very iffy.
Rust's borrowing rules might force you to make different architecture choices than you would with C. But that's not what I was thinking about. For a given rust function, where you might expect a C programmer to need to interact due to a change in the the C code, most of the lifetime rules will have already been hammered out before the needed updates to the rust code. It's possible, but unlikely, that the C programmer…
Re: Rust in the kernel is no longer experimental
#566Earlier quoted context omitted.
> But today we do have Java which has all of the rust safety guarantees and then some, is insanely performant for network code and has a massive amount of mindshare and available programmers. I'm not entirely convinced that Java has much mindshare among system programmers. During my 15 years career in the field I haven't heard "Boy I wish we wrote this in Java" once.
I've seen plenty of networking code in Java, including very large scale video delivery platforms, near real time packet analysis and all kinds of stuff that I would have bet were not even possible in Java. If there is one thing that I'm really impressed by then it is how far Java has come performance wise, from absolutely dog slow to being an insignificant fraction away from low level languages. And I'm not a fan (to…
Re: Rust in the kernel is no longer experimental
#567Earlier quoted context omitted.
https://lwn.net/Articles/1045363/ > Rust, which has been cited as a cause for concern around ensuring continuing support for old architectures, supports 14 of the kernel's 20-ish architectures, the exceptions being Alpha, Nios II, OpenRISC, PARISC, and SuperH.
> supports 14 of the kernel's 20-ish architectures That's a lot better than I expected to be honest, I was thinking maybe Rust supported 6-7 architectures in total, but seems Rust already has pretty wide support. If you start considering all tiers, the scope of support seems enormous: https://doc.rust-lang.org/nightly/rustc/platform-support.htm...
Re: Rust in the kernel is no longer experimental
#568Earlier quoted context omitted.
I'm genuinely surprised that usize pointer convertibility exists. Even Go has different types for pointer-width integers (uintptr) and sizes of things (int/uint). I can only guess that Rust's choice was seen as a harmless simplification at the time. Is it something that can be fixed with editions? My guess is no, or at least not easily.
There is a cost to having multiple language-level types that represent the exact same set of values, as C has (and is really noticeable in C++). Rust made an early, fairly explicit decision that a) usize is a distinct fundamental type from the other types, and not merely a target-specific typedef, and b) not to introduce more types for things like uindex or uaddr or uptr, which are the same as usize on nearly every p…
Yet Rust is not Go and this solution is probably not the right one for Rust. As laid out in a link on a sibling comment, one possibility is to do away with pointer integer conversions entirely, and use methods on pointers to access and mutate their addresses (which may be the only thing they represent on some platforms, but is just a part of their representation on others). The broader issue is really about evolving the language and ecosystem away from the mentality that "pointers are just integers with fancy sigil names".
Re: Rust in the kernel is no longer experimental
#569I never used linux because it was built using C++. Never have I cared what language the product was built it. The Rust community however wants you to use a product just because it's implemented in Rust, or atleast as one of the selling points. For that reason I decided to avoid any product that advertises using Rust as a selling point, as much as I can. Was planning to switch from Mac to a Linux machine, not anymore,…
Re: Rust in the kernel is no longer experimental
#570Earlier quoted context omitted.
> technically Rust is still safer than C in its unsafe blocks This is quite dubious in a practical sense, since Rust unsafe blocks must manually uphold the safety invariants that idiomatic Safe Rust relies on at all times, which includes, e.g. references pointing to valid and properly aligned data, as well as requirements on mutable references comparable to what the `restrict` qualifier (which is rarely used) involve…
It's great that the Google Android team has been tracking data to answer that question for years now and their conclusion is: ------- The primary security concern regarding Rust generally centers on the approximately 4% of code written within unsafe{} blocks. This subset of Rust has fueled significant speculation, misconceptions, and even theories that unsafe Rust might be more buggy than C. Empirical evidence shows…
> The additional scrutiny that unsafe{} blocks receive.
None of this supports an argument that "unsafe Rust is safer than C". It's just saying that with enough scrutiny on those unsafe blocks, the potential bugs will be found and addressed as part of development. That's a rather different claim.