On Fri, 2025-02-28 at 12:00 +0000, Sam James wrote: > Basile Starynkevitch <bas...@starynkevitch.net> writes: > > > Hello Bright Andoh, > > > > > > > > My name is Bright Andoh, and I’m a Computer Engineering student at the > > > University of Alabama. I’m wrapping up my freshman year and have > > > experience working with Rust and C. Last fall, I collaborated on some > > > Rust projects with a friend, and I’m eager to deepen my understanding, > > > especially in compiler development and large codebases. > > > > > > > Long time ago, I did contribute to GCC (its plugin infrastructure). > > https://arxiv.org/pdf/1109.0779 (perhaps this paper could be relevant to > > you) > > > > A possible approach to your goal might be: > > > > become familiar with GCC code base so be able to compile it (on a Linux > > computer) from source code. Be prepared to spend a few days on that. > > > > be able to run the GDB debugger on the GCC compiler (actually its cc1). Be > > prepared to spend a few days on that. > > > > study the source code of the existing Rust compiler > > https://www.rust-lang.org/, > > only the front-end (e.g. macros & ownership things). > > > > Adapt it to GCC using libgccjit. This means understanding the current rust > > compiler internals and using libgccjit to feed GCC. > > > > https://gcc.gnu.org/onlinedocs/jit/ > > > > so my suggestion could be to prototype your Rust frontend as a GCC plugin > > (and > > reuse as much as possible existing frontend from > > https://www.rust-lang.org/) > > > > I'm sorry, but this advice is mistaken/misplaced. > > GCC *has* a rust frontend in-tree and it's one of our listed GSoC ideas > to help contribute to it at > https://gcc.gnu.org/wiki/SummerOfCode#Selected_Project_Ideas. > > Not only that, there is additionally a libgccjit backend for the > rust-lang.org implementation of rustc, see > https://github.com/rust-lang/rustc_codegen_gcc.
Then you need to define your goals: 1. obtain a GCC frontend to Rust independent of any existing code on https://github.com/rust-lang/ 2. improve the existing GCC rust frontend to fit into latest Rust standard. Probably by running the existing testsuite (of rust-lang) 3. have similar (or not) diagnostics -- Basile STARYNKEVITCH <bas...@starynkevitch.net> 8 rue de la Faïencerie 92340 Bourg-la-Reine, France http://starynkevitch.net/Basile & https://github.com/bstarynk