Originally posted by cardich
View Post
Announcement
Collapse
No announcement yet.
LPC 2022: Rust Linux Drivers Capable Of Achieving Performance Comparable To C Code
Collapse
X
-
Originally posted by jacob View Post
Actually significant parts of the Linux kernel do get rewritten every now and then. For now Rust will be used for "leaf" modules only, so not in the core kernel, but if Rust is successful there, then it may change. Of course for various reasons the rewritters may not necessarily always use Rust even when it's available, but I wouldn't be surprised if by the end of the decade we have some Rust code in the process scheduler or memory manager.
- Likes 1
Comment
-
-
-
Originally posted by PAUL007 View PostIs modern Cpp bad for memory handling ?
That's not the point though, despite all the shouting you hear about it. The difference, and sole benefit of Rust, is that if (i.e. realistically "when", for any team of more than a handful of people) you screw up the Rust code will fail to compile; whereas the C++ code will fail at runtime. One of those outcomes is significantly more desirable than the other.
Comment
-
Originally posted by arQon View PostNo - in fact, it's provably as "perfect" / correct as Rust is.
That's not the point though, despite all the shouting you hear about it. The difference, and sole benefit of Rust, is that if (i.e. realistically "when", for any team of more than a handful of people) you screw up the Rust code will fail to compile; whereas the C++ code will fail at runtime. One of those outcomes is significantly more desirable than the other.
Lot of the issues rust prevent using Coverity and other full program C++ tools will prevent as well. Then you notice something rust prevents the problem when you build a single object file but with C++ and C with extra notation cannot instead requires complete program source.
Note I said extra notation item that do extra notation is items like sparse with the Linux kernel. Rust language in fact more strict language on what has to be include so the information is there that issues can be solved in a single source file making a single object.
C++ code failing at runtime is not 100 percent correct. C++ code failing when complete program is built is the true answer. Remember full program being built this could be runtime or this could be complete program static analysis. Being at the complete program point is not ideal for productivity. Like you have modified one source file ideal is just remake that object and make the program for testing. C and C++ having to run complete program analysis or some form to find problems is really not ideal.
Over the years C and C++ compilers have been adding more and more Static program analysis but there is still the problem that the C and C++ language does not have the data to lot of the static program analysis without processing the complete program. Remember this is a bigger nightmare when people are using closed third party libraries because the C/C++ headers to standard don't in fact declare enough information to perform Static program analysis.
Rust fails when you make object for 100 percent of rust detectable faults.
C and C++ attempts with modern compilers to fail when you make object with items like address sanitizer but then you notice its missed stuff that it magically detects when you use link time optimization and yes link time optimization is running address sanitizer complete program where it has more information and has to perform lot of process to work out the information. Remember the faults rust prevents includes address sanitizer detected faults when you make the object.
The reality here C and C++ in theory are both fixable to be rust quality language. But the fix would be a code breaking change. As in compilers would have to refuse to build different C and C++ files until extra information is added describing how different items should behave.
- Likes 1
Comment
-
Comment