News for hackers. Stuff that matters.
Re:Linus Torvalds on Rust support in kernel by wycy on Friday April 16, 2021 @09:32AM (#26833651)
> The more you make it look like (Kernel) C, the easier it is for us C people to actually read. My eyes have been reading C for almost 30 years by now, they have a lexer built in the optical nerve; reading something that looks vaguely like C but is definitely not C is an utterly painful experience.

I think he makes a good point about the fact that it's certainly possible the Rust code written today won't still compile in 10 years, but writing Rust in C-style seems like a terrible approach. Write using the idioms of the language used.

Re:Linus Torvalds on Rust support in kernel by Hackbraten on Friday April 16, 2021 @10:17AM (#26834170)
> I think he makes a good point about the fact that it's certainly possible the Rust code written today won't still compile in 10 years

It’s possible but unlikely. The Editions feature [1] has been specifically designed to provide longevity.

[1]: https://doc.rust-lang.org/edition-guide/editions/index.html

Re:Linus Torvalds on Rust support in kernel by HelloNurse on Friday April 16, 2021 @11:08AM (#26834806)
Section 3.16 ("Platform and target support") of the linked document is so inadequate for Linux kernel related questions, such as "what compilation targets will be supported by this Rust Edition in 10 years", that there is nothing to quote to show it's inadequate. It doesn't even tell what compilation targets are supported right now.
Re:Linus Torvalds on Rust support in kernel by steveklabnik on Friday April 16, 2021 @11:12AM (#26834861)
The canonical link for platform support is here: https://doc.rust-lang.org/stable/rustc/platform-support.html
Re:Linus Torvalds on Rust support in kernel by HelloNurse on Saturday April 17, 2021 @05:51AM (#26842988)
There is no commitment to keeping the platforms in tier 1, 2 or 3 for any length of time or to provide advance warning before platforms are degraded, not to mention that the tier 1 list is vastly insufficient (Arm64, x86, x86_64).

Rustc is clearly meant to compile Rust applications and use for the Linux kernel, which from the point of view of this document would be narrower than tier 1, is highly experimental.

Re:Linus Torvalds on Rust support in kernel by steveklabnik on Saturday April 17, 2021 @10:59AM (#26844691)
Where does Linux document how long platforms are guaranteed support? My understanding is there's not either.

(And yes, we'd love to expand the tier list. It's a chicken and egg situation. That being said, I work mostly in tier 2 and 3 targets, and they just vary a lot. The ones I work in work as good as tier 1 targets do. The path to moving forward is bright for many of these.)

> Rustc is clearly meant to compile Rust applications

I don't see what about this implies that at all. As a core team member and someone writing an embedded OS at work, I can assure you that we don't think of Rust as purely an application language.

Re:Linus Torvalds on Rust support in kernel by HelloNurse on Saturday April 17, 2021 @12:22PM (#26845408)
Maybe I'm unfamiliar with Rust, but if you list OSX, Linux and Windows on identical processors as different platforms they are platforms for applications, not for an OS kernel that runs on "bare metal": it implies that support includes relying on OS provided system calls to manage processes, implement the standard library, etc.
Re:Linus Torvalds on Rust support in kernel by steveklabnik on Saturday April 17, 2021 @12:42PM (#26845592)
Sure, the standard library on those targets depends on OS services. But you don’t have to use the standard library. Many people do write userspace programs in Rust, just like they do in C. That doesn’t mean that it’s only useful or intended for userspace, just like C.

It takes more work to port an entire standard library than to not.

Re:Linus Torvalds on Rust support in kernel by myrrlyn on Saturday April 17, 2021 @01:41PM (#26845991)
unless you plan to run `rustc` as a kernelspace application, anything in tier 2 (`core`, `alloc`, maybe `std` all compile and likely pass tests) is sufficient
Re:Linus Torvalds on Rust support in kernel by mcguire on Friday April 16, 2021 @01:48PM (#26836985)
Personal pet peeve: new people who come into a project without any context and use their own idiosyncratic code style. :-)
Re:Linus Torvalds on Rust support in kernel by alfonsodev on Friday April 16, 2021 @10:11AM (#26834100)
I agree, but if it helps creating more and better drivers, it might be a good thing considering the lifetime of the target hardware matches Rust lifetime.