News for hackers. Stuff that matters.
Re:Rust needs to run, and be easy to use, on every platform by andrewaylett on Thursday March 08, 2018 @01:57PM (#16546663)
https://github.com/tsgates/rust.ko implements a simple module in Rust. When you can expose C bindings to your functions and don't need much runtime support, there aren't really many limitations to what you can do.
Re:Rust needs to run, and be easy to use, on every platform by jeffreyrogers on Thursday March 08, 2018 @01:59PM (#16546672)
Good luck getting it in the mainline kernel though...
Re:Rust needs to run, and be easy to use, on every platform by masklinn on Thursday March 08, 2018 @02:20PM (#16546840)
You're not going to get a C++ kernel module in mainline either.
Re:Rust needs to run, and be easy to use, on every platform by jancsika on Thursday March 08, 2018 @03:41PM (#16547450)
I'd be very curious to hear Linus' thoughts on Rust.

Has anyone posted a flippant request on the kernel dev list to support kernel modules written in Rust?

Be sure to mention:

* how safe Rust is

* how unsafe C is

* reiterate that "this is the 21st century, people"

Re:Rust needs to run, and be easy to use, on every platform by steveklabnik on Thursday March 08, 2018 @04:42PM (#16547890)
I hate to link to Quora, but I’m on mobile so I apologize in advance. The only time I’m aware of Linus commenting on Rust is https://www.quora.com/What-does-Linus-Torvalds-think-of-Rust

I would hope that nobody trolls the LKML like that. Not even Rust people think that the kernel should adopt Rust.

Re:Rust needs to run, and be easy to use, on every platform by jancsika on Thursday March 08, 2018 @08:05PM (#16549123)
Thanks for that link-- that's about as good a compliment as I can imagine Linus giving another programming language. :)
Re:Rust needs to run, and be easy to use, on every platform by josteink on Thursday March 08, 2018 @03:42PM (#16547460)
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.

Re:Rust needs to run, and be easy to use, on every platform by jeffreyrogers on Thursday March 08, 2018 @03:52PM (#16547530)
For 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.

Re:Rust needs to run, and be easy to use, on every platform by johnny22 on Thursday March 08, 2018 @05:41PM (#16548366)
I definitely see why you couldn't replace linux or postgres with rust rewrites anytime soon, but nginx?

Nginx seems totally probable.

Re:Rust needs to run, and be easy to use, on every platform by the_grue on Friday March 09, 2018 @04:36AM (#16550686)
> 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.

Re:Rust needs to run, and be easy to use, on every platform by steveklabnik on Friday March 09, 2018 @05:12AM (#16550848)
In 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.

Re:Rust needs to run, and be easy to use, on every platform by jeffreyrogers on Friday March 09, 2018 @09:58AM (#16552128)
I meant Linux kernel modules in particular. Rust seems fine for the kernel in general.