4 ms·
If you watch the actual talk and check code at https://github.com/Rust-for-Linux https://github.com/Rust-for-Linux you will see that it’s actually pretty heavy
by Matthias247 4y ago
If you watch the actual talk and check code at https://github.com/Rust-for-Linux https://github.com/Rust-for-Linux you will see that it’s actually pretty heavy on generics and macros. Eg for the trait that defines file system operations (https://github.com/Rust-for-Linux/linux/blob/459035ab65c0ebb8d7054b24b6c00de907819eb2/rust/kernel/file.rs#L774 https://github.com/Rust-for-Linux/linux/blob/459035ab65c0ebb...) and other bindings to C code. I was actually surprised of seeing those, since they certainly don’t help with telling people a story that Rust is an easy language. But it’s probably the best one can do when having to interface with predefined APIs.
But You are certainly right in that external dependencies won’t be an issue.
- kibwen 4y agoThe trait there doesn't look concerning to me (e.g. none of its methods are generic (its methods do use associated types, but those are pretty trivial to resolve or generate code for; there's only ever one set of associated types per impl, whereas with generic functions there's the potential for combinatorial code explosion depending on usage)). However, I do see a custom `vtable` macro in there, and indeed macros can be a concern for compilation speed if they're not implemented with compiler-friendliness in mind. But other than that, I'd say that file shouldn't represent a problem for the compiler.