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...
That's the primary problem with Rust and similar languages - they can't actually interface with anything, especially not hardware, without writing unsafe code. And every language with those sorts of goals has run into those problems from Perl to Ruby to Rust, at some point, you have to declare an unsafe structure safe and cross your fingers that you didn't forget an edge case.
Hence those languages still don't really have native GPU/OpenCL/CUDA support without some major hackery or simply having wrappers at which point you may as well be writing in Python, as the C-libraries are where the real work goes.
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:3, Insightful)
That's the primary problem with Rust and similar languages - they can't actually interface with anything, especially not hardware, without writing unsafe code. And every language with those sorts of goals has run into those problems from Perl to Ruby to Rust, at some point, you have to declare an unsafe structure safe and cross your fingers that you didn't forget an edge case.
Hence those languages still don't really have native GPU/OpenCL/CUDA support without some major hackery or simply having wrappers at which point you may as well be writing in Python, as the C-libraries are where the real work goes.
Re: Like C++, Rust is a different way to structure (Score:3)
You'll probably use unsafe at some point, but most of your code doesn't need to be unsafe.
Re: (Score:1)
Depends on what you're doing. If you're just calling wrappers, I wouldn't call that "safe" code.