Remix.run Logo
LeFantome 2 days ago

> There are many architectures that NetBSD supports where Rust is not available

Are there many architectures that NetBSD supports where GCC is not available?

The rustc_codegen_gcc project allows using the rustc compiler to target any architecture that GCC supports. I think it is pretty far along.

https://github.com/rust-lang/rustc_codegen_gcc

> getting a Rust compiler running in the first place is hard

> bootstrap relies on a binary package

> the compiler would also have to be part of the base system

The gccrs project aims to make Rust a fully supported language in GCC. It is fully self-hosting and can be built from source. Once accepted, it will be one of the languages you get when you build GCC.

https://github.com/Rust-GCC/gccrs

When gccrs is ready, it will address all the above objections.

Linux faces the same issues. Today, Rust is optional in Linux and can be skipped on any platform not supported in LLVM and rustc. For Rust to become mandatory in Linux, gccrs is going to be required (for some platforms).

> the release cycles of Rust are not compatible with the NetBSD ones

I do not fully grasp the objection here. Obviously NetBSD would not be forced to use any Rust features they cannot compile. And using gccrs for the NetBSD kernel would not prevent them from bundling LLVM and rustc as well if they want.

Anyway, I am not advocating the use of Rust in NetBSD. I am merely pointing out that solutions to the issues raised are being worked on.

LeFantome 2 days ago | parent [-]

I just noticed that rustc_codegen_gcc has been accepted into the mainline Rust compiler, or at least the nightly builds.

https://github.com/rust-lang/rust/pull/151156

This means that you will be able to use either GCC or LLVM to build your Rust code with rustc (the main Rust compiler). That means you can compile your Rust for any platform that GCC supports.

This only addresses the first point in the blog post (architecture support) but it is an interesting development.