Skip to content

refactor(codegen): migrate member.ts to typeOf()#594

Merged
cs01 merged 1 commit intomainfrom
refactor/typeof-member
Apr 20, 2026
Merged

refactor(codegen): migrate member.ts to typeOf()#594
cs01 merged 1 commit intomainfrom
refactor/typeof-member

Conversation

@cs01
Copy link
Copy Markdown
Owner

@cs01 cs01 commented Apr 20, 2026

Summary

  • Migrates 2 this.ctx.resolveExpressionTypeRich(...) call sites in member.ts (indexed-object-array element info at line 2233, optional-chain through method-call/call returning named interfaces at line 2890) to the canonical this.ctx.typeOf(...).
  • Renames the MemberAccessGeneratorContext interface member from resolveExpressionTypeRich to typeOf.
  • Closes out non-type-inference consumer migrations for Phase-E step 5. Remaining resolveExpressionTypeRich callers are the type-annotator itself (sink of the cache) and internal typeInference recursion.

User-facing effect

  • No behavior change. Single canonical type lookup across codegen for member access. Eliminates the "annotator cache says one thing, on-demand resolver says another" silent-wrong class across all member-access paths.

Test plan

  • npm run verify — full tests + 3-stage self-host green locally
  • CI green

…rst, falls through to rich resolver (phase-e step 5)
@github-actions
Copy link
Copy Markdown
Contributor

Benchmark Results (Linux x86-64)

Benchmark C ChadScript Go Node Place
Cold Start 0.7ms 0.6ms 1.1ms 26.2ms 🥇
Fibonacci 0.725s 0.722s 1.430s 2.840s 🥇
Hash Map Lookup 0.104s 0.065s 0.095s 0.137s 🥇
Monte Carlo Pi 0.402s 0.387s 0.406s 1.474s 🥇
JSON Parse/Stringify 0.032s 0.045s 0.172s 0.134s 🥈
Matrix Multiply 0.448s 0.459s 0.473s 0.481s 🥈
N-Body Simulation 1.425s 1.853s 1.946s 2.272s 🥈
Regex Match 0.014s 0.004s 0.020s 0.004s 🥈
SQLite 0.046s 0.333s 0.464s 0.436s 🥈
Binary Trees 1.362s 1.407s 3.012s 1.385s 🥉
File I/O 0.076s 0.077s 0.076s 0.241s 🥉
Quicksort 0.169s 0.215s 0.183s 0.248s 🥉
Sieve of Eratosthenes 0.031s 0.041s 0.038s 0.058s 🥉
String Manipulation 0.008s 0.021s 0.016s 0.036s 🥉

CLI Tool Benchmarks

Benchmark ChadScript grep node xxd Place
Hex Dump 0.484s 0.998s 0.068s 🥈
Recursive Grep 0.012s 0.008s 0.101s 🥈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant