hash-org / hash-org/hashc

sc: Separate discovery and some of resolution into a separate scope-check pass

Open
#1,017 0 comments 0 reactions 1 assignee Claimed by @kontheocharis View on GitHub
Dominant language
Rust
Stars
28
Forks
1
PR merge metrics
No merged PRs in 30d

Description

The idea is to transition to having the following passes after untyped analysis:

- Scope checking: This checks that all declarations are referenced in a valid way, there are no undeclared references, and no circular references. The output of this stage should be something like a "name graph" of all the scopes, declarations, and their references.

- TIR lowering: This pass simply takes the AST, and with the help of the output of the previous stage, it constructs the TIR tree.

- Type checking: this populates the TIR with types and ensures that everything is well typed. Here, some compile-time evaluation also occurs.

Currently, all these are bundled into the semantic analysis pass, which does discovery (now scope checking), resolution (now TIR lowering), and type checking. They should be broken up to make the codebase simpler, to be able to gather more granular metrics, and to be able to abstract the stages further and reduce inter-dependence. (e.g. scope checking does not need to know at all about TIR)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.