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
Category | Last Month | This Month | Delta |
ToDo | 25 | 35 | +10 |
In Progress | 4 | 5 | +1 |
Completed | 6 | 23 | +17 |
Testsuite status
Test Cases | Last Month | This Month | Delta |
Passing | 40 | 124 | +84 |
Failing | 4 | 8 | +4 |
Milestones Progress
Milestone | Last Month | This Month | Delta |
Core Data Structures | 38% | 61% | +23% |
Basic Control Flow | 0% | 14% | +14% |
Generics | 0% | 0% | 0% |
Traits | 0% | 0% | 0% |
Pattern Matching | 0% | 0% | 0% |
Imports | 0% | 0% | 0% |
Risks
Risk | Impact (1-3) | Likelihood (1-10) | Risk (I * L) | Mitigation |
Copyright assignments | 2 | 5 | 10 | Be 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