(Re)Using rustc components in gccrs
The gccrs project is developing an alternative Rust compiler by integrating components from rustc, starting with rustc_parse_format and planning to include polonius, while addressing internal representation challenges.
Read original articleThe gccrs project aims to develop an alternative Rust compiler using components from the official Rust compiler (rustc) to ensure compatibility and performance. The team has begun integrating various rustc components, starting with rustc_parse_format, which parses Rust format strings for proper string formatting and inline assembly. This integration is crucial for maintaining consistent behavior between gccrs and rustc, especially in complex areas like borrow-checking. The next significant component planned for integration is polonius, a next-generation borrow-checker that enhances the current borrow-checking algorithm. The project faces challenges due to the differences in internal representations between gccrs (written in C++) and rustc (written in Rust), which complicates the reuse of components. The team is committed to ensuring that gccrs mirrors rustc's behavior to avoid discrepancies in error handling and runtime behavior. Currently, gccrs relies on rustc and Cargo to compile these components, with plans to fully integrate them once gccrs is more mature. The bootstrapping process involves creating an intermediate compiler to facilitate the integration of Rust components, ultimately leading to a fully functional Rust compiler with enhanced capabilities.
- gccrs is developing an alternative Rust compiler by reusing components from rustc.
- The first integrated component is rustc_parse_format, which handles Rust format strings.
- Future integration includes polonius, a next-generation borrow-checker.
- Differences in internal representations between gccrs and rustc pose challenges for component reuse.
- The project aims to ensure consistent behavior between gccrs and rustc, particularly in error handling.
Related
Rust on Dreamcast
Rust, a popular systems programming language, is being adapted for Dreamcast's SuperH architecture. Developers can use rustc_codegen_gcc and gccrs to compile Rust programs with core and alloc support. Ongoing improvements aim for full std functionality.
FreeBSD considers Rust in the base system
FreeBSD is discussing the potential integration of Rust into its base system, facing concerns about build times and compatibility, while no concrete plans have been established yet.
Rust GPU Transitions to Community Ownership
The Rust GPU project has moved to community ownership to improve GPU programming in Rust, focusing on GPU compute and GPGPU programming, with goals for better stability and integration into the Rust compiler.
FreeBSD considers Rust in the base system
The FreeBSD Project is reconsidering integrating Rust into its base system, with developers divided on its benefits and challenges, influenced by past experiences with Perl's integration. No concrete plans exist yet.
Linux-for-Rust or Rust-for-Linux
The integration of Rust into the Linux kernel faces skepticism over usability, performance, and support issues, while some developers advocate for its potential, citing successful implementations and the need for better compiler support.
> First, we use a C++ compiler to build gccrs, disabling the borrow-checking pass of the compiler. It is important to ensure borrow-checking cannot be disabled at runtime using a command line flag, as this could have a negative impact on the Rust ecosystem – however, building gccrs without borrow-checking to use it as an intermediate compiler in our bootstrapping process is okay.
It's not like Polonius or the trait solver were designed with bootstrapping gccrs in mind.
Related
Rust on Dreamcast
Rust, a popular systems programming language, is being adapted for Dreamcast's SuperH architecture. Developers can use rustc_codegen_gcc and gccrs to compile Rust programs with core and alloc support. Ongoing improvements aim for full std functionality.
FreeBSD considers Rust in the base system
FreeBSD is discussing the potential integration of Rust into its base system, facing concerns about build times and compatibility, while no concrete plans have been established yet.
Rust GPU Transitions to Community Ownership
The Rust GPU project has moved to community ownership to improve GPU programming in Rust, focusing on GPU compute and GPGPU programming, with goals for better stability and integration into the Rust compiler.
FreeBSD considers Rust in the base system
The FreeBSD Project is reconsidering integrating Rust into its base system, with developers divided on its benefits and challenges, influenced by past experiences with Perl's integration. No concrete plans exist yet.
Linux-for-Rust or Rust-for-Linux
The integration of Rust into the Linux kernel faces skepticism over usability, performance, and support issues, while some developers advocate for its potential, citing successful implementations and the need for better compiler support.