As I understand it, Rust does not like pointer structures because it does not have garbage collection. (I am talking about things like linked lists, not simply owned pointers like strings and vectors.) So rust encourages array lists instead.
I would expect the C based kernel to be riddled with pointer structures. In which case it is difficult to see how that could be converted to rust unless lots of unsafe code is written.
It is a bit like you can have C with Classes, but real C++ uses RAII which is a diff
Well C doesn't have garbage collection either.. and the kernel code just self-manages all of these structures. You can easily use pointer structure style code without a garbage collector.. maybe that's not trivial in rust.. but it will need to be able to manage it in order to interact with C bindings...
Indeed. I suspect so much of the kernel code that would be written in Rust would be declared inside "unsafe" blocks that there'd be little point using over C or C++ in the first place.
Unsafe in rust doesn't make it as unsafe as c, in fact it retains a lot of safety features. For one thing, the borrow checker is where rust gets a lot of its memory safety, and that still remains fully intact no matter what you do.
All great discoveries are made by mistake.
-- Young
A couple years back it was C++ (Score:4, Informative)
I still remember when they added C++ to the kernel. They had the same arguments and it never went anywhere.
Like C++, Rust is a different way to structure (Score:2)
As I understand it, Rust does not like pointer structures because it does not have garbage collection. (I am talking about things like linked lists, not simply owned pointers like strings and vectors.) So rust encourages array lists instead.
I would expect the C based kernel to be riddled with pointer structures. In which case it is difficult to see how that could be converted to rust unless lots of unsafe code is written.
It is a bit like you can have C with Classes, but real C++ uses RAII which is a diff
Re: (Score:2)
Re:Like C++, Rust is a different way to structure (Score:2)
Indeed. I suspect so much of the kernel code that would be written in Rust would be declared inside "unsafe" blocks that there'd be little point using over C or C++ in the first place.
Re: Like C++, Rust is a different way to structure (Score:2)
Unsafe in rust doesn't make it as unsafe as c, in fact it retains a lot of safety features. For one thing, the borrow checker is where rust gets a lot of its memory safety, and that still remains fully intact no matter what you do.