GCC Front-End For Rust

Alternative Rust Compiler for GCC

View the Project on GitHub

October 2023 Monthly report

Overview

Thanks again to Open Source Security, inc and Embecosm for their ongoing support for this project.

Milestone Progress

We spent the majority of our time this month preparing patches, or fixing them after receiving reviews on the mailing lists. Some of these patches take a long time to upstream and review, as they touch common complex parts of the GCC project such as the build system, which we are currently fighting with to integrate a new libgrust folder containing various libraries useful to gccrs, such as those related to our procedural macros implementation. These patches are necessary to upstream before the rest of the work done this year, as intrinsic compiler features have been moved to this directory. Once this is done, we will be able to simply push the new patches upstream, after short modifications to make them more suitable to the upstream GCC project. At the moment, there are around 900 patches being prepared, with the hope of pushing them before the end of the month. We are also exploring solutions to help automate this process a little more, as it represents very time consuming work which we would like to avoid in the future - keeping upstream up to date with our development repository, with weekly or bi-weekly updates, should prove worthwhile in the long term.

On the technical side, a lot of bugs were fixed this month again thanks to our contributor team. Jakub Dupak has been making some amazing progress on borrow-checking in gccrs, with the development of a new, simplified intermediate representation specifically designed to interact with the polonius borrow-checker. At the moment, our compiler can start emitting simple errors, such as “use after move” errors:

fn test_move() {
    // this struct cannot be copied
    struct A {
        i: i32,
    }
    let a = A { i: 1 };

    let b = a; // first move
    let c = a; // second move occurs here
}

or simple lifetime analysis:

// this errors out...
fn foo<'a, 'b>(x: &'a usize) -> &'b usize {
    x // we can't know if x will live long enough, so this is an error
}

// ...but this is valid, since we specify that 'a must outlive 'b
fn foo2<'a, 'b>(x: &'a usize) -> &'b usize
    where 'a: 'b
{
    x
}

At the moment, errors are not yet formatted or displayed to the user, but the invalid behavior is caught and the compiler errors out. This work is extremely exciting, and we are looking forward to more progress from Jakub! Great work!

We also got in touch with the GCC release maintainers to understand what was expected of gccrs for it to be an integral part of the GCC 14.1 release, and should be able to fulfill the requirements (println!() macro, simple Rust examples working…). We are very excited for everyone to be able to try the compiler.

Finally, October also saw Pierre-Emmanuel and Arthur go to EuroRust, where they had an amazing time. We are looking forward to coming back next year. We gave a small talk on the compiler, and the challenges of compiling the standard Rust library, which we will link to once released.

Community call

We will have our next monthly community call on the 13th of November

  1. You can subscribe to our calendar to see when the next one will be held. The call is open to everyone, even if you would just like to sit-in and listen. You can also subscribe to our mailing-list or join our Zulip chat to be notified of upcoming events.

Completed Activities

Contributors this month

Overall Task Status

Category Last Month This Month Delta
TODO 256 265 +9
In Progress 55 65 +10
Completed 747 765 +18

Test Cases

TestCases Last Month This Month Delta
Passing 8176 8203 +27
Failed - - -
XFAIL 69 69 -
XPASS - - -

Bugs

Category Last Month This Month Delta
TODO 93 98 +5
In Progress 29 38 +9
Completed 366 382 +16

Milestones Progress

Milestone Last Month This Month Delta Start Date Completion Date Target
Data Structures 1 - Core 100% 100% - 30th Nov 2020 27th Jan 2021 29th Jan 2021
Control Flow 1 - Core 100% 100% - 28th Jan 2021 10th Feb 2021 26th Feb 2021
Data Structures 2 - Generics 100% 100% - 11th Feb 2021 14th May 2021 28th May 2021
Data Structures 3 - Traits 100% 100% - 20th May 2021 17th Sep 2021 27th Aug 2021
Control Flow 2 - Pattern Matching 100% 100% - 20th Sep 2021 9th Dec 2021 29th Nov 2021
Macros and cfg expansion 100% 100% - 1st Dec 2021 31st Mar 2022 28th Mar 2022
Imports and Visibility 100% 100% - 29th Mar 2022 13th Jul 2022 27th May 2022
Const Generics 100% 100% - 30th May 2022 10th Oct 2022 17th Oct 2022
Initial upstream patches 100% 100% - 10th Oct 2022 13th Nov 2022 13th Nov 2022
Upstream initial patchset 100% 100% - 13th Nov 2022 13th Dec 2022 19th Dec 2022
Update GCC’s master branch 100% 100% - 1st Jan 2023 21st Feb 2023 3rd Mar 2023
Final set of upstream patches 100% 100% - 16th Nov 2022 1st May 2023 30th Apr 2023
Borrow Checking 1 0% 0% - TBD - 15th Aug 2023
AST Pipeline for libcore 1.49 78% 78% - 13th Apr 2023 - 1st Jul 2023
HIR Pipeline for libcore 1.49 69% 69% - 13th Apr 2023 - TBD
Procedural Macros 1 100% 100% - 13th Apr 2023 - 6th Aug 2023
GCC 13.2 Release 100% 100% - 13th Apr 2023 22nd Jul 2023 15th Jul 2023
GCC 14 Stage 3 100% 100% - 1st Sep 2023 20th Sep 2023 1st Nov 2023
core 1.49 functionality [AST] 4% 4% - 1st Jul 2023 - 1st Nov 2023
Rustc Testsuite Prerequisistes 0% 0% - TBD - 1st Feb 2024
Intrinsics and builtins 18% 18% - 6th Sep 2022 - TBD
Const Generics 2 0% 0% - TBD - TBD
Rust-for-Linux compilation 0% 0% - TBD - TBD
GCC 14.1 Release 0% 0% - TBD - 15th Apr 2024
Procedural Macros 2 0% 57% +57% TBD - TBD

Testing project

Testsuite Compiler Last month This month Success delta
rustc testsuite gccrs -fsyntax-only 92.7% 92.7% -
gccrs testsuite rustc stable 59.2% 59.2% -
rustc testsuite passing tests gccrs 14.0% 14.0% -
rustc testsuite (nostd) gccrs 27.5% 27.5% -
rustc testsuite (nocore) gccrs 3.8% 3.8% -
blake3 gccrs 25.0% 25.0% -
libcore gccrs 0% 0% -

Planned Activities

Detailed changelog