[SAOC 2025] Separate Semantic Routines from AST Nodes Weekly Update #8
Mohamed El Shorbagy
mohrizq895 at gmail.com
Mon Nov 10 21:26:09 UTC 2025
# Summary of Progress (Nov. 03 - Nov. 10)
This week I worked on the following:
1. Filtering the dependency graph so that it contains only paths
to semantic files (forming a dependency tree). This could be
achieved through simple depth-first traversal on the complete
graph, taking the file of interest as the source node. Some
AST-related files not only have semantic dependencies near the
root but also really deep in the tree. The proper approach we
thought of is to tackle the dependencies near the root first in
all files, then go breadth-first.
2. `mtype.d` is still dependent on `typesem.d` in many places, so
it should be tackled one at a time. `Type.toBaseType` is such an
example. This function is used in many places across the frontend
code; however, we are interested in the AST-related files, which
are:
- `cond.d`, specifically in `StaticForEach.ready` (see [Merged
PR](https://github.com/dlang/dmd/pull/22065/files)).
- `dtemplate.d`, specifically `reliesOn*` functions (see
[Merged PR](https://github.com/dlang/dmd/pull/22064)).
- `expression.d` in some free functions (see [Merged
PR](https://github.com/dlang/dmd/pull/22066/)) and `normalize`,
which is tricky. `toInteger`, `toUInteger`, `toReal`, and
`toComplex` are all dependent on `normalize`, and they are
handled [here](https://github.com/dlang/dmd/pull/22073) and
[here](https://github.com/dlang/dmd/pull/22076). The trick is
that the constructor of `IntegerExp` still depends on that
function, so I am still figuring out the best approach for that.
More information about the Digitalmars-d
mailing list