If GNU please: Rust support merged for the forthcoming GCC 13
(2022/12/15)
- Reference: 1671100208
- News link: https://www.theregister.co.uk/2022/12/15/gcc_13_rust_support_merged/
- Source link:
Preliminary support for compiling the Rust language has been merged into the codebase for GCC 13, which will be the next version of the GNU compiler collection.
The Reg 's sister site DevClass [1]reported on the approval back in July, along with a timeline of when to expect the next steps, and now the code merge has happened. This is a good thing, and it's significant step for the Rust language – but there is a whole list of "buts" attached to this news.
The [2]Rust-GCC project has been underway for a couple of years, as can be seen from the earliest commits on its [3]Github page. The last time we wrote about it, when covering [4]Linus Torvalds' keynote at the Open Source Summit , we attracted criticism for, um, quoting the project's own description from that page, saying how preliminary it was. Some Rustaceans regarded this as unfair, which may possibly tell you more about the fervor of Rust fans than it tells you about the GCC compiler's state of completion.
[5]
Support in GCC will mean that there are two compilers able to build Rust code. The [6]Rust Project itself is building the language using [7]LLVM , a suite of tools for building compilers, such as the [8]Clang C compiler that's been [9]favored by Apple since [10]XCode 3.2 for Mac OS X 10.6 "Snow Leopard", back in 2009.
[11]
[12]
(Incidentally, Apple built tooling to use LLVM as an optimizing back-end to GCC, and [13]offered the [14]code to the GNU Project, but it was rejected, in part [15]because the code was in C++, the language LLVM is built in. GCC, like much of the GNU Project, is built in C. This highlights just one fundamental difference in the path of bringing Rust to GCC.)
For a compiled programming language, having more than a single compiler is an important sign of its maturity and stability. But Rust is relatively new, and only attained version 1.0 in 2015, as we noted when [16]covering its fifth birthday a couple of years ago. That means it's a moving target for the team working on the GCC compiler to try to hit.
[17]
So far, there have been three [18]"editions" of the language, which the Rust book [19]defines as follows:
At the time of this writing, three Rust editions are available: Rust 2015, Rust 2018, and Rust 2021.
Another way to track its evolution is the version numbers. So far, the project's own [20]release history lists 21 versions (omitting alphas and betas). The email [21]message from the GCC mailing list accepting the Rust patch set quotes from Rust-on-GCC project lead [22]Philip Herron 's submission email:
For some context, my current project plan brings us to November 2022 where we (unexpected events permitting) should be able to support valid Rust code targeting Rustc version ~1.40
When considering Rust in different places, its version numbers become highly significant. As [23]LWN reported, the Linux kernel 6.1 preliminary support for Rust stipulates [24]version 1.62 , released in June.
As we write, the current version of Rust is [25]version 1.65.0 . Rust 1.4, which is what the Rust-on-GCC support is currently aiming at, is quite a lot older: it was [26]announced on October 29, 2015.
[27]Open source community split over offer of 'corporate' welfare for critical dev tools
[28]The GNOME Project is closing all its mailing lists
[29]'Merge window from Hell' opens as Linus Torvalds reveals Linux 6.1
[30]MacOS9.app: A tour de force of emulation and integration
[31]Big changes coming in Debian 12: Some parts won't be FOSS
[32]Open source databases: What are they and why do they matter?
That looks like quite a significant gap to us. The version of the patch-set that was accepted is the fourth, and contributor Arthur Cohen also [33]posted some words of caution:
Please note however that despite the language being in, the compiler is still at an extremely early stage. We are still not able to properly compile Rust code in the version that we target, 1.49.
To do anything meaningful with the language, you will also need the core library, which again, we cannot compile yet in its 1.49 version.
This is very much an extremely experimental compiler and will still get a lot of changes in the coming weeks and months up until the release.
The Rust-on-GCC project isn't the only alternative Rust toolchain being worked on. [34]MrustC , or Mutabah's Rust Compiler , is another, being implemented in C++ and which emits, as the project page puts it, "currently very ugly C, but LLVM/ [35]cretone / [36]GIMPLE /… could work" . There's also [37]rustc_codegen_gcc , a work-in-progress GCC code generator that uses [38]libgccjit .
All this activity is very encouraging, though. In our recent story about [39]Linux support for laptop and desktop Arm kit , we reported the very favorable [40]comments about Rust from the developer working on the graphics drivers for the GPU in Apple's M1-powered Macs. With open source code, often a big hurdle is getting a first version out there; after that, people pile in with bug fixes and performance improvements, and things can then improve surprisingly rapidly.
Get our [41]Tech Resources
[1] https://devclass.com/2022/07/12/rust-gcc-front-end-approved-by-steering-committee-beta-expected-in-gcc-13/
[2] https://rust-gcc.github.io/
[3] https://github.com/Rust-GCC/gccrs
[4] https://www.theregister.com/2022/09/16/rust_in_the_linux_kernel/
[5] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=2&c=2Y5r@aqkxCceFrxLMO@wNuwAAAIY&t=ct%3Dns%26unitnum%3D2%26raptor%3Dcondor%26pos%3Dtop%26test%3D0
[6] https://www.rust-lang.org/
[7] https://llvm.org/
[8] https://clang.llvm.org/
[9] https://opensource.apple.com/source/clang/clang-23/clang/tools/clang/www/comparison.html
[10] https://developer.apple.com/library/archive/documentation/CompilerTools/Conceptual/LLVMCompilerOverview/index.html
[11] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44Y5r@aqkxCceFrxLMO@wNuwAAAIY&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[12] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33Y5r@aqkxCceFrxLMO@wNuwAAAIY&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0
[13] https://gcc.gnu.org/legacy-ml/gcc/2005-11/msg00888.html
[14] https://gcc.gnu.org/legacy-ml/gcc/2005-11/msg01112.html
[15] https://gcc.gnu.org/legacy-ml/gcc/2005-11/msg01126.html
[16] https://www.theregister.com/2020/05/15/rust_marks_five_years_since/
[17] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44Y5r@aqkxCceFrxLMO@wNuwAAAIY&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[18] https://doc.rust-lang.org/edition-guide/editions/index.html
[19] https://doc.rust-lang.org/book/appendix-05-editions.html
[20] https://forge.rust-lang.org/archive/release-history.html
[21] https://gcc.gnu.org/pipermail/gcc/2022-July/239057.html
[22] https://thephilbert.io/
[23] https://lwn.net/Articles/910762/
[24] https://blog.rust-lang.org/2022/06/30/Rust-1.62.0.html
[25] https://blog.rust-lang.org/2022/11/03/Rust-1.65.0.html
[26] https://blog.rust-lang.org/2015/10/29/Rust-1.4.html
[27] https://www.theregister.com/2022/11/16/sourceware_open_source_openssf/
[28] https://www.theregister.com/2022/10/27/the_gnome_project_is_closing/
[29] https://www.theregister.com/2022/12/11/linux_6_1/
[30] https://www.theregister.com/2022/12/09/macos9app_emulation/
[31] https://www.theregister.com/2022/10/03/debian_12/
[32] https://www.theregister.com/2022/09/05/open_source_databases/
[33] https://gcc.gnu.org/pipermail/gcc-patches/2022-December/607971.html
[34] https://github.com/thepowersgang/mrustc
[35] https://github.com/Amanieu/cretonne
[36] https://gcc.gnu.org/onlinedocs/gccint/GIMPLE.html
[37] https://github.com/antoyo/rustc_codegen_gcc
[38] https://gcc.gnu.org/wiki/JIT
[39] https://www.theregister.com/2022/12/06/arm64_laptops/
[40] https://asahilinux.org/2022/11/tales-of-the-m1-gpu/
[41] https://whitepapers.theregister.com/
The Reg 's sister site DevClass [1]reported on the approval back in July, along with a timeline of when to expect the next steps, and now the code merge has happened. This is a good thing, and it's significant step for the Rust language – but there is a whole list of "buts" attached to this news.
The [2]Rust-GCC project has been underway for a couple of years, as can be seen from the earliest commits on its [3]Github page. The last time we wrote about it, when covering [4]Linus Torvalds' keynote at the Open Source Summit , we attracted criticism for, um, quoting the project's own description from that page, saying how preliminary it was. Some Rustaceans regarded this as unfair, which may possibly tell you more about the fervor of Rust fans than it tells you about the GCC compiler's state of completion.
[5]
Support in GCC will mean that there are two compilers able to build Rust code. The [6]Rust Project itself is building the language using [7]LLVM , a suite of tools for building compilers, such as the [8]Clang C compiler that's been [9]favored by Apple since [10]XCode 3.2 for Mac OS X 10.6 "Snow Leopard", back in 2009.
[11]
[12]
(Incidentally, Apple built tooling to use LLVM as an optimizing back-end to GCC, and [13]offered the [14]code to the GNU Project, but it was rejected, in part [15]because the code was in C++, the language LLVM is built in. GCC, like much of the GNU Project, is built in C. This highlights just one fundamental difference in the path of bringing Rust to GCC.)
For a compiled programming language, having more than a single compiler is an important sign of its maturity and stability. But Rust is relatively new, and only attained version 1.0 in 2015, as we noted when [16]covering its fifth birthday a couple of years ago. That means it's a moving target for the team working on the GCC compiler to try to hit.
[17]
So far, there have been three [18]"editions" of the language, which the Rust book [19]defines as follows:
At the time of this writing, three Rust editions are available: Rust 2015, Rust 2018, and Rust 2021.
Another way to track its evolution is the version numbers. So far, the project's own [20]release history lists 21 versions (omitting alphas and betas). The email [21]message from the GCC mailing list accepting the Rust patch set quotes from Rust-on-GCC project lead [22]Philip Herron 's submission email:
For some context, my current project plan brings us to November 2022 where we (unexpected events permitting) should be able to support valid Rust code targeting Rustc version ~1.40
When considering Rust in different places, its version numbers become highly significant. As [23]LWN reported, the Linux kernel 6.1 preliminary support for Rust stipulates [24]version 1.62 , released in June.
As we write, the current version of Rust is [25]version 1.65.0 . Rust 1.4, which is what the Rust-on-GCC support is currently aiming at, is quite a lot older: it was [26]announced on October 29, 2015.
[27]Open source community split over offer of 'corporate' welfare for critical dev tools
[28]The GNOME Project is closing all its mailing lists
[29]'Merge window from Hell' opens as Linus Torvalds reveals Linux 6.1
[30]MacOS9.app: A tour de force of emulation and integration
[31]Big changes coming in Debian 12: Some parts won't be FOSS
[32]Open source databases: What are they and why do they matter?
That looks like quite a significant gap to us. The version of the patch-set that was accepted is the fourth, and contributor Arthur Cohen also [33]posted some words of caution:
Please note however that despite the language being in, the compiler is still at an extremely early stage. We are still not able to properly compile Rust code in the version that we target, 1.49.
To do anything meaningful with the language, you will also need the core library, which again, we cannot compile yet in its 1.49 version.
This is very much an extremely experimental compiler and will still get a lot of changes in the coming weeks and months up until the release.
The Rust-on-GCC project isn't the only alternative Rust toolchain being worked on. [34]MrustC , or Mutabah's Rust Compiler , is another, being implemented in C++ and which emits, as the project page puts it, "currently very ugly C, but LLVM/ [35]cretone / [36]GIMPLE /… could work" . There's also [37]rustc_codegen_gcc , a work-in-progress GCC code generator that uses [38]libgccjit .
All this activity is very encouraging, though. In our recent story about [39]Linux support for laptop and desktop Arm kit , we reported the very favorable [40]comments about Rust from the developer working on the graphics drivers for the GPU in Apple's M1-powered Macs. With open source code, often a big hurdle is getting a first version out there; after that, people pile in with bug fixes and performance improvements, and things can then improve surprisingly rapidly.
Get our [41]Tech Resources
[1] https://devclass.com/2022/07/12/rust-gcc-front-end-approved-by-steering-committee-beta-expected-in-gcc-13/
[2] https://rust-gcc.github.io/
[3] https://github.com/Rust-GCC/gccrs
[4] https://www.theregister.com/2022/09/16/rust_in_the_linux_kernel/
[5] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=2&c=2Y5r@aqkxCceFrxLMO@wNuwAAAIY&t=ct%3Dns%26unitnum%3D2%26raptor%3Dcondor%26pos%3Dtop%26test%3D0
[6] https://www.rust-lang.org/
[7] https://llvm.org/
[8] https://clang.llvm.org/
[9] https://opensource.apple.com/source/clang/clang-23/clang/tools/clang/www/comparison.html
[10] https://developer.apple.com/library/archive/documentation/CompilerTools/Conceptual/LLVMCompilerOverview/index.html
[11] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44Y5r@aqkxCceFrxLMO@wNuwAAAIY&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[12] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33Y5r@aqkxCceFrxLMO@wNuwAAAIY&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0
[13] https://gcc.gnu.org/legacy-ml/gcc/2005-11/msg00888.html
[14] https://gcc.gnu.org/legacy-ml/gcc/2005-11/msg01112.html
[15] https://gcc.gnu.org/legacy-ml/gcc/2005-11/msg01126.html
[16] https://www.theregister.com/2020/05/15/rust_marks_five_years_since/
[17] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44Y5r@aqkxCceFrxLMO@wNuwAAAIY&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[18] https://doc.rust-lang.org/edition-guide/editions/index.html
[19] https://doc.rust-lang.org/book/appendix-05-editions.html
[20] https://forge.rust-lang.org/archive/release-history.html
[21] https://gcc.gnu.org/pipermail/gcc/2022-July/239057.html
[22] https://thephilbert.io/
[23] https://lwn.net/Articles/910762/
[24] https://blog.rust-lang.org/2022/06/30/Rust-1.62.0.html
[25] https://blog.rust-lang.org/2022/11/03/Rust-1.65.0.html
[26] https://blog.rust-lang.org/2015/10/29/Rust-1.4.html
[27] https://www.theregister.com/2022/11/16/sourceware_open_source_openssf/
[28] https://www.theregister.com/2022/10/27/the_gnome_project_is_closing/
[29] https://www.theregister.com/2022/12/11/linux_6_1/
[30] https://www.theregister.com/2022/12/09/macos9app_emulation/
[31] https://www.theregister.com/2022/10/03/debian_12/
[32] https://www.theregister.com/2022/09/05/open_source_databases/
[33] https://gcc.gnu.org/pipermail/gcc-patches/2022-December/607971.html
[34] https://github.com/thepowersgang/mrustc
[35] https://github.com/Amanieu/cretonne
[36] https://gcc.gnu.org/onlinedocs/gccint/GIMPLE.html
[37] https://github.com/antoyo/rustc_codegen_gcc
[38] https://gcc.gnu.org/wiki/JIT
[39] https://www.theregister.com/2022/12/06/arm64_laptops/
[40] https://asahilinux.org/2022/11/tales-of-the-m1-gpu/
[41] https://whitepapers.theregister.com/