Originally posted by PAUL007
View Post
Announcement
Collapse
No announcement yet.
LPC 2022: Rust Linux Drivers Capable Of Achieving Performance Comparable To C Code
Collapse
X
-
-
IMO the main reason why NVMe is an interesting test case is that it is representative of any driver for modern high-speed hardware, with multiple I/O queues to be managed.
For people asking why C++ is not used, my personal take on C++ is that it has more abstraction capability just like Rust, but the abstractions you build with C++ are leaky, in other words you still need to understand many details of the abstraction to use it correctly. Rust on the other hand is a little less expressive but focuses on allowing you to build watertight abstractions that you can absolutely rely on. That makes the pain/gain ratio much more favorable, at least in my opinion.
Of course in the end, the reason why C++ is not used is that Linus does not like C++, and he has his own reasons. He is undecided but open minded about Rust.Last edited by zcansi; 13 September 2022, 03:31 AM.
- Likes 12
Comment
-
Originally posted by Developer12 View PostI'm not sure why anyone would be surprised by this. The rust driver does essentially the same job, while rust itself accomplishes all it's checks at compile-time. There's no runtime overhead. As bugs in various systems of tagging get worked out in LLVM, it's quite possible that rust will pull ahead of C/C++ thanks to optimizations that currently can't be deployed upon C/C++ code.
- Likes 9
Comment
-
Originally posted by PAUL007 View PostIs modern Cpp bad for memory handling ?
Most serious bugs have their root into code which was hacked under time pressure. They are not crashes but strange behavior. And most crashes are simply running into asserts. I don't see how Rust would fix that. I think more test driven development could help but that is hard to enforce. Nobody wants pseudo tests.
Actually I was surprised that Rust is not stronger on this front. You could do much more on the language level to make testing easier. You can not catch all bugs at compile time. Most input is happening at runtime. So you need tests for that.
- Likes 7
Comment
-
Originally posted by patrick1946 View Post
It really depends. You can easily shoot yourself into the foot but you can use smart pointers and a crash handler who sends dumps. Most of our crashes happen in the graphics driver. But this are not the serious bugs.
Most serious bugs have their root into code which was hacked under time pressure. They are not crashes but strange behavior. And most crashes are simply running into asserts. I don't see how Rust would fix that. I think more test driven development could help but that is hard to enforce. Nobody wants pseudo tests.
Actually I was surprised that Rust is not stronger on this front. You could do much more on the language level to make testing easier. You can not catch all bugs at compile time. Most input is happening at runtime. So you need tests for that.
- Likes 8
Comment
-
Originally posted by piotrj3 View Post
Rust is not ADA or SPARK (especially that one). Rust only aimed to have memory safety, better concurrency and avoiding few bad design choices like multi-polimorphism and exceptions. Rust was not made to catch all bugs, it was meant to fix memory related issues that are hard to track and fix.
- Likes 9
Comment
Comment