GCC Rust Status Monthly Report #1 – December 2020

Since November 23rd the feedback from rustc compiler developers bjorn3 and Philipp Krones have been crucial in designing a proper architecture for the compiler moving forward. The code was not going to be able to handle to declare first, generics and traits uniformly. This first month a new HIR IR has been added with a node ID mapping system akin to rustc which allows implementation of the Hindley Milner type inferencing algorithm, which requires all nodes to be unified with rules to determine types.

Consider declare first case we must examine all usages of the name x:

let x; // inference variable _
x = 1; // i32

Using type resolution rules it is possible to implement the following case.

let mut x; // _
x = None; // option<_>
x = 1; // option<i>32

As part of this large re-architecture a new name and type resolver are in place which have been designed with thought towards generics and traits down the line. GCCRS is still on track to complete the Core Data structure milestone.

Special thanks to SimplyTheOther for his parser bug fixes this month. When this project was resurrected earlier in 2020 we joined forces by taking his new parser since the existing parser targeted rust 0.8.

For this year of funding I believe the best usage of my time is to get onto implementing generics and traits where the most complexity and unknowns lie for the compiler.

Completed Activities

  • Introduce new HIR (high-level-IR)
  • HIR mappings for new name and type resolution
  • Type classes to implement Hindley-Milner type inferencing
  • Shadowing rules – Scoping rules
  • Arrays – Constants
  • Bug fixes for parsing expressions within ArrayIndex
  • Automate the test suite as part of make check
  • Docker Builds
  • Setup Reporting
  • Prepared Blog Posts

Overall Task Status

CategoryLast MonthThis MonthDelta
ToDo2535+10
In Progress45+1
Completed623+17
GitHub issues/milestones/projects tracking

Testsuite status

Test CasesLast MonthThis MonthDelta
Passing40124+84
Failing48+4
make check-rust

Milestones Progress

MilestoneLast MonthThis MonthDelta
Core Data Structures38%61%+23%
Basic Control Flow0%14%+14%
Generics0%0%0%
Traits0%0%0%
Pattern Matching0%0%0%
Imports0%0%0%
milestones

Risks

RiskImpact (1-3)Likelihood (1-10)Risk (I * L)Mitigation
Copyright assignments2510Be up front on all PRs that the code is destined to be upstreamed to FSF

Planned Activities

  • Complete core data structure milestone
  • Start trying to use the RustC testsuite against GCCRS
  • Ensure adequate testcase coverage
  • Announcement blog posts
  • announcement email to GCC mailing list
  • Mirror the code over on GCC Git as a branch

Leave a Reply

Your email address will not be published. Required fields are marked *