<story><title>Progress toward a GCC-based Rust compiler</title><url>https://lwn.net/SubscriberLink/954787/41470c731eda02a4/</url></story><parent_chain><item><author>vlovich123</author><text>The claims in the article feel kinda weak as to the motivation.&lt;p&gt;&amp;gt; Cohen&amp;#x27;s EuroRust talk highlighted that one of the major reasons gccrs is being developed is to be able to take advantage of GCC&amp;#x27;s security plugins. There is a wide range of existing GCC plugins that can aid in debugging, static analysis, or hardening; these work on the GCC intermediate representation&lt;p&gt;&amp;gt; One more reason for gccrs to exist is Rust for Linux, the initiative to add Rust support to the Linux kernel. Cohen said the Linux kernel is a key motivator for the project because there are a lot of kernel people who would prefer the kernel to be compiled only by the GNU toolchain.&lt;p&gt;That explains why you’d want GCC as the backend but not why you need a duplicate front end. I think it’s a bad idea to have multiple front ends and Rust should learn from the mistakes of C++ which even with a standards body has to deal with a mess of switches, differing levels of language support for each compiler making cross-platform development harder, platform-specific language bugs etc etc.&lt;p&gt;&amp;gt; A lot of care is being put into gccrs not becoming a &amp;quot;superset&amp;quot; of Rust, as Cohen put it. The project wants to make sure that it does not create a special &amp;quot;GNU Rust&amp;quot; language, but is trying instead to replicate the output of rustc — bugs, quirks, and all. Both the Rust and GCC test suites are being used to accomplish this.&lt;p&gt;In other words, I’d love gccrs folks to explain why their approach is a better one than rustc_codegen_gcc considering the latter is able to achieve this with far less effort and risk.</text></item></parent_chain><comment><author>ndiddy</author><text>Having another Rust implementation allows for an &amp;quot;audit&amp;quot; to help validate the Rust spec and get rid of any unspecified behavior. It would also give users options. If I hit a compiler bug in MSVC, I can file a report, switch to GCC and keep working on my project until the bug is fixed. With Rust, that&amp;#x27;s not currently possible.</text></comment>
<story><title>Progress toward a GCC-based Rust compiler</title><url>https://lwn.net/SubscriberLink/954787/41470c731eda02a4/</url></story><parent_chain><item><author>vlovich123</author><text>The claims in the article feel kinda weak as to the motivation.&lt;p&gt;&amp;gt; Cohen&amp;#x27;s EuroRust talk highlighted that one of the major reasons gccrs is being developed is to be able to take advantage of GCC&amp;#x27;s security plugins. There is a wide range of existing GCC plugins that can aid in debugging, static analysis, or hardening; these work on the GCC intermediate representation&lt;p&gt;&amp;gt; One more reason for gccrs to exist is Rust for Linux, the initiative to add Rust support to the Linux kernel. Cohen said the Linux kernel is a key motivator for the project because there are a lot of kernel people who would prefer the kernel to be compiled only by the GNU toolchain.&lt;p&gt;That explains why you’d want GCC as the backend but not why you need a duplicate front end. I think it’s a bad idea to have multiple front ends and Rust should learn from the mistakes of C++ which even with a standards body has to deal with a mess of switches, differing levels of language support for each compiler making cross-platform development harder, platform-specific language bugs etc etc.&lt;p&gt;&amp;gt; A lot of care is being put into gccrs not becoming a &amp;quot;superset&amp;quot; of Rust, as Cohen put it. The project wants to make sure that it does not create a special &amp;quot;GNU Rust&amp;quot; language, but is trying instead to replicate the output of rustc — bugs, quirks, and all. Both the Rust and GCC test suites are being used to accomplish this.&lt;p&gt;In other words, I’d love gccrs folks to explain why their approach is a better one than rustc_codegen_gcc considering the latter is able to achieve this with far less effort and risk.</text></item></parent_chain><comment><author>bryanlarsen</author><text>&amp;gt; Rust should learn from the mistakes of C++&lt;p&gt;They are.   You quoted them doing it, the care taken not to become a superset.  The problem with C&amp;#x2F;C++ stemmed from compiler vendors competing with each other to  be &amp;quot;better&amp;quot; than their peers.&lt;p&gt;Multiple front ends of an implementation of a language usually shakes out a bunch of bugs and misimplementations.   That&amp;#x27;s the primary benefit of having multiple front ends IMO.</text></comment>