42 ms·
By that reasoning C is the only language you can use to write kernel modules. Which is not a very interesting or productive reasoning when discussing the actua
by josteink 9y ago
By that reasoning C is the only language you can use to write kernel modules.
Which is not a very interesting or productive reasoning when discussing the actual merits and capabilities of a programming language.
- jeffreyrogers 9y agoFor all practical purposes C is the only language that is used to write kernel modules on Linux. I like Rust a lot actually, but kernel modules aren't a good use case for it. Edit: the_grue actually has an interesting criticism of Rust, which is that a lot of existing systems problems-- problems that Rust would be well suited for--are already addressed with large C/C++ codebases. Since it's unlikely you're going to replace Linux, postgres, nginx, etc. it is interesting to ask what systems applications Rust can be used for now, without requiring people to rewrite their applications in Rust or allow Rust code to be mixed in with existing C/C++ code.
- johnny22 9y agoI definitely see why you couldn't replace linux or postgres with rust rewrites anytime soon, but nginx? Nginx seems totally probable.
- the_grue 9y ago> I like Rust a lot actually, but kernel modules aren't a good use case for it. If we're talking about kernel modules in general, I'd have to disagree. I think it's a perfect language for kernel, as long it's all written in Rust. I only wanted to point out the practical impossibility of integration with existing infrastructure, such as Linux kernel, which is written entirely in C.
- steveklabnik 9y agoIn general, Rust can work great with C projects. This is, after all, part of what it was originally created for: to replace bits of Firefox (which is C++, but that makes it harder, not easier). That said, the kernel has special requirements; I'd never advocate such a thing for Linux, specifically.
- jeffreyrogers 9y agoI meant Linux kernel modules in particular. Rust seems fine for the kernel in general.