Originally posted by darkonix
View Post
Announcement
Collapse
No announcement yet.
Rust For Linux Kernel v9 Patches Trim Things Down Greatly For Easier Upstreaming
Collapse
X
-
-
Originally posted by kpedersen View Post
I said "core useful parts". Gonna have to strip a lot more out than just STL
In kernel land, that will mean stripping exceptions, RTTI. Probably also excluding the use of references and RAII. Its usage will end up even being closer to C99, than K&R C is to C99.
Leave a comment:
-
Originally posted by Volta View Post
There will be no c++ crap in the kernel if you didn't notice yet.
Leave a comment:
-
Originally posted by kpedersen View Post
I agree with references. But RAII does hide a fair amount of implementation.
I am mainly just going by what subsets of C++ others use. For example MISRA.
Leave a comment:
-
All you have to do is remove STL and create an "STL" and std "lib" that is kernel appropriate. The same amount of work that rust needs if not less. RAII has nothing to do with it whatsoever. And you are still left with lambda, objects, meta-programming etc. Knowing enough about the language that you know what to remove but then saying that you are left with C is beyond retarded.
- Likes 1
Leave a comment:
-
Originally posted by ssokolow View Post
Wasn't part of that about C++ constructs like new/delete leaning on "allocation failure reported via exceptions"?
§4.1: “C++” projects commonly ban exceptions,because today’s dynamic exception types violate the zero-overhead principle,and do not have statically bound able space and time costs. In particular, throw requires dynamic allocation and catch of a type requires RTTI.—We must at minimum enable all C++ projects to enable exception handling and to use the standard language and library.This paper proposes extending C++’s exception handling to let functions declare that they throw a statically known type by value,so that the implementation can opt into an efficient implementation (a compatible ABI extension). Code that uses only this efficient exception handling has zero space and time overhead compared to returning error codes.
What you see in Rust? Ah that's right no_std. The issue is almost all nice features of C++ are hidden behind std or something you can't use in kernel mode.
- Likes 1
Leave a comment:
-
Originally posted by Sergey Podobry View PostI bet you don't have much experience with C++. It's way more better and safer than C while maintain the same low level features and zero cost abstractions.
It would be interesting to have an actual list concrete benefits and features that should be excluded because they are not appropriate for the Kernel to understand in more deep the real impact.
- Likes 1
Leave a comment:
-
Originally posted by ssokolow View PostI also got the impression that Linus was not a fan of a language which has "userland-first" design features like transparently adding a vtable member in your struct or class if you want to use the language's syntactic sugar for dynamic dispatch and a tendency to encourage people to think in failure-by-exception.
- Likes 1
Leave a comment:
Leave a comment: