Merged Rust support for upcoming GCC 13 • The Register

Preliminary support for compiling the Rust language has been integrated into the codebase for GCC 13, which will be the next version of the GNU compiler suite.

the regDevClass’s sister site reported the approval back in July, along with a timeline of when to expect next steps, and now the code merge is done. That’s a good thing and a significant step for the Rust language—but there’s a whole list of “buts” attached to this message.

The Rust-GCC project has been running for a few years, as evidenced by the earliest commits on its Github page. The last time we wrote about this, when we covered Linus Torvald’s keynote at the Open Source Summit, we drew criticism for quoting the project’s own description from that site and saying how preliminary it was . Some Rustaceans felt this was unfair, which perhaps says more about Rust fans’ excitement than the GCC compiler’s level of completion.

Support in GCC means there are two compilers that can create Rust code. The Rust project itself builds the language using LLVM, a suite of tools for building compilers like the Clang-C compiler, preferred by Apple since XCode 3.2 for Mac OS X 10.6 “Snow Leopard” in 2009.

(By the way, Apple developed tools to use LLVM as an optimizing backend for GCC and offered the code to the GNU project, but it was rejected, partly because the code was in C++, the language that LLVM is built into. GCC, like much of the GNU project, is written in C. This just underscores a fundamental difference in the way Rust is brought into GCC.)

For a compiled programming language to have more than a single compiler is an important sign of its maturity and stability. But Rust is relatively new, only reaching version 1.0 in 2015, as we noted when reporting on its fifth birthday a few years ago. That means it’s a moving target for the team working on the GCC compiler to try to achieve.

So far there have been three “editions” of the language, which the Rust book defines as follows:

At the time of writing, there are three Rust editions available: Rust 2015, Rust 2018, and Rust 2021.

Another way to track its development is through the version numbers. So far, the project’s own release history lists 21 releases (excluding alphas and betas). The email message from the GCC mailing list accepting the Rust patch set citations from the Rust-on-GCC project prefaced Philip Herron’s submission email:

In some context, my current project plan brings us to November 2022, when (unexpected events permitting) we should be able to support valid Rust code for Rustc version ~1.40

Looking at Rust in different places, its version numbers become of great importance. As LWN reports, preliminary support for the Linux kernel 6.1 for Rust includes version 1.62 released in June.

As of this writing, the current version of Rust is version 1.65.0. Rust 1.4, which is currently targeted by Rust-on-GCC support, is quite a bit older: it was announced on October 29, 2015.

That looks like a pretty big gap to us. The accepted version of the patch set is the fourth, and contributor Arthur Cohen also posted some words of caution:

However, please note that the compiler is still at a very early stage, despite the language already in place. We’re still not able to properly compile Rust code in the 1.49 version we’re targeting.

In order to do anything useful with the language, you also need the core library, which again we can’t compile in version 1.49 yet.

This is a highly experimental compiler and will see many changes over the coming weeks and months leading up to release.

The Rust-on-GCC project isn’t the only alternative Rust toolchain being worked on. MrustC or Mutabah’s Rust compileris another one implemented in C++ which the project page says outputs: “currently very ugly C, but LLVM/cretone/GIMPLE/… might work”. There is also rustc_codegen_gcc, a work in progress GCC code generator that uses libgccjit.

However, all these activities are very encouraging. In our recent story on Linux support for laptop and desktop arm kits, we reported the very positive comments about Rust from the developer working on the graphics drivers for the GPU in Apple’s M1-powered Macs. With open source code, a major hurdle is often getting a first release to market; After that, people pile in with bug fixes and performance improvements, and things can then improve surprisingly quickly.

https://www.theregister.com/2022/12/15/gcc_13_rust_support_merged/ Merged Rust support for upcoming GCC 13 • The Register

Rick Schindler

World Time Todays is an automatic aggregator of the all world’s media. In each content, the hyperlink to the primary source is specified. All trademarks belong to their rightful owners, all materials to their authors. If you are the owner of the content and do not want us to publish your materials, please contact us by email – admin@worldtimetodays.com. The content will be deleted within 24 hours.

Related Articles

Back to top button