You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Type-checker: memoise type checks on common subexpressions (str_concat / format) #16
This is the other suggested fix direction from the original OOM report:
Memoise type checks on common subexpressions (especially repeated str_concat/format AST nodes).
PR #12 implemented the depth guard but deliberately did not attempt memoisation. This issue tracks the optional, larger refactor.
Why this is non-trivial
The internal type Ty is structurally Clone-able and small, but Expr is not currently Hash/Eq-keyable on its own (spans differ even for structurally-equal expressions; lambdas capture environment).
A naive HashMap<*const Expr, Ty> keyed by pointer identity would help for literally shared subexpressions but not for structurally identical re-occurrences of the same format("...", [name, lang]) across different functions.
A content-addressed key (hash of structural form, ignoring spans) is more useful but requires a careful definition of structural equality.
Activity