October 11th, 2024

An Update on Gccrs Development

The gccrs project, a Rust frontend for GCC, has made significant progress, reducing upstream commits to 40, focusing on key features, and aims to compile the Rust core library despite challenges.

Read original articleLink Icon
An Update on Gccrs Development

The development of gccrs, a Rust frontend for the GCC compiler, is progressing, addressing concerns about the lack of multiple compilers for Rust. Pierre-Emmanuel Patry provided an update at the 2024 GNU Tools Cauldron, noting that the project, which restarted in 2019, has made significant strides since its inception. Initially targeting Rust version 1.49, gccrs has been included in GCC since version 14, although documentation was not part of that release. The number of commits needing upstreaming has decreased from over 800 to 40, indicating progress. The team, supported by three Google Summer of Code interns, has focused on critical features such as inline assembly support, a test-suite adapter, and borrow checking. The immediate goal is to enable gccrs to compile the Rust core library, which has proven challenging due to experimental features in the library. While the compiler is currently slow, the developers aim to improve performance after achieving feature completeness. Long-term objectives include catching up to Rust version 1.78 and eventually building the standard library. However, the project faces challenges due to limited developer resources and a lack of industry support, which could hinder its potential to provide a second compiler for Rust.

- The gccrs project aims to create a Rust frontend for the GCC compiler.

- Significant progress has been made, reducing the number of upstream commits from over 800 to 40.

- Key features being developed include inline assembly support and a test-suite adapter.

- The immediate goal is to compile the Rust core library, which has encountered various challenges.

- The project requires more industry support to succeed and provide a viable alternative to the existing Rust compiler.

Link Icon 4 comments
By @omoikane - 7 months
> the trademark rules around the language prevent it from being called a Rust compiler

Maybe they can call it a Crab compiler, see also:

https://news.ycombinator.com/item?id=36122270 - Rust has been forked to the Crab Language (2023-05-30)

By @duped - 7 months
To the "but why" comments, there are some legitimate questions about backends for LLVM - what targets does gcc support that it is easier to write a frontend for a complex language like Rust than add a backend for the desired targets?

I can think of some plausible reasons, like:

- The backends were contributed by people that have no interest in writing another backend in a different compiler framework or are retired/dead/not paid to do it anymore and no one knows the intracies anymore

- Implementing a backend for LLVM is actually harder than writing a new frontend for GCC due to the instability of LLVM IR

But I'm interested what others think. It seems like the industry could burn the candle from both ends, as it were.

By @adastra22 - 7 months
I think the “but why?” comments are on point. The reason for standardization in C/C++ (proprietary compilers) does not exist for rust. If you’re worried about breakage across compiler releases, then peg the compiler version. Modern tooling doesn’t gets the problems C/C++ standards and multiple implementations solve.

I see not just zero but actual negative utility to a second rustic implementation.