Originally posted by evasb
View Post
Announcement
Collapse
No announcement yet.
Updated Rust Code For Linux Kernel Patches Posted
Collapse
X
-
- Likes 3
-
-
Originally posted by uid313 View PostThere are some problems with the Rust language:- Long compile times / slow build
- The resulting binary produced is large
- You cannot declare async functions inside a trait
- Libraries built using a async runtime are incompatible with other libraries built using a different async runtime
- Likes 22
Comment
-
Originally posted by uid313 View PostThere are some problems with the Rust language:- Long compile times / slow build
Originally posted by uid313 View Post- The resulting binary produced is large
Originally posted by uid313 View Post- You cannot declare async functions inside a trait
Originally posted by uid313 View Post- Libraries built using a async runtime are incompatible with other libraries built using a different async runtime
- Likes 19
Comment
-
Originally posted by uid313 View PostYou cannot declare async functions inside a trait
Originally posted by uid313 View PostLibraries built using a async runtime are incompatible with other libraries built using a different async runtime
Originally posted by linner View PostYay, more bloat and less performance. Just what a kernel needs. Just get a bigger faster computer to make up for the poor software, problem "solved", like always.
- Likes 9
Comment
-
Originally posted by intelfx View PostThis might be a genuine problem, but typically it's seen in context of crate bloat (where, if your program has a large list of dependencies, Node.js/Python-style, you have to compile them along with your code, and compilation times add up). In context of kernel development, crate bloat likely won't be a thing at all.
Same.
Also, the rust compiler is mostly sequential when it comes to compiling a single crate, which is sometimes worked around by splitting larger crates into multiple smaller ones.
I don't think people want to design the kernel according to compilation times.
So there is an issue here and progress is only slowly being made. However, I do see compilation times as an acceptable issue when at the same time solving more severe security issues. Also, we are making improvements (e.g. looking at LLVM's new PassManager) and I expect that cg_gcc is also going to help here.
- Likes 1
Comment
-
Originally posted by xerom62 View PostThere's no such thing as kernel C. It's just C and nothing remotely close to C++. The real challenge with kernel development is learning the ins and outs of the kernel itself which you will do regardless of C or Rust.
Yes you have a static analyser with the Linux kernel that you have to add annotations to your C code so your C code is acceptable. Yes those annotations for sparse can at times make it tricker to take code from the Linux kernel and put them in a different OS that is general C kernel.
Yes there are quite a few faults that you can code in general C that when you run builds with Linux with sparse on come build failures with the Linux kernel. So mainline Linux kernel C does not have the same list of failures as normal C and part because the Linux kernel C is extended.
- Likes 6
Comment
-
Originally posted by intelfx View PostThis is simply due to the fact that the Rust standard library is always linked statically (while in languages people tend to compare Rust to, the standard library is often linked dynamically).
There's also work on statically linking only the parts of stdlib that are actually used, in order to further decrease the executable size, but afaik, nothing's mainlined yet.
It can be a problem for embedded development, but it's acknowledged and being worked on. I don't see how it would be a problem in this context, Rust is supposed to be used for device drivers at first.
- Likes 2
Comment
-
Originally posted by V1tol View PostI know only two big async runtimes - tokio and async-std. And 99% of libraries I've seen and/or used are built around tokio. At least this language has ability to plug in async runtimes. Who also allows that? I think in future we will see special kernel async runtime based on kernel magic (if that thing exists at all).
Give it time. They're currently hammering out things like the std replacement for lazy_static and once_cell. If they hadn't waited on that, we'd be stuck with a lazy_static-style API when the younger once_cell proved to be the better design that's getting adopted.
- Likes 4
Comment
Comment