Skip to content

refactor(codegen): widen VariableAllocatorContext with typeOf + resolveExpressionTypeRich#578

Merged
cs01 merged 1 commit intomainfrom
refactor/typed-ast-va
Apr 20, 2026
Merged

refactor(codegen): widen VariableAllocatorContext with typeOf + resolveExpressionTypeRich#578
cs01 merged 1 commit intomainfrom
refactor/typed-ast-va

Conversation

@cs01
Copy link
Copy Markdown
Owner

@cs01 cs01 commented Apr 20, 2026

Adds typeOf + resolveExpressionTypeRich to VariableAllocatorContext so future migrations in variable-allocator.ts can opt in. No behavior change. The actual per-declaration call stays on flat resolveExpressionType pending investigation of a native-vs-node codegen divergence exposed when swapping (see task #45 notes).

@cs01 cs01 force-pushed the refactor/typed-ast-va branch from b7f4ea6 to 9536bb5 Compare April 20, 2026 13:52
@cs01 cs01 changed the title refactor(codegen): migrate variable-allocator to typeof() (phase-e step 5) refactor(codegen): widen VariableAllocatorContext with typeOf + resolveExpressionTypeRich Apr 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 20, 2026

Benchmark Results (Linux x86-64)

Benchmark C ChadScript Go Node Place
Cold Start 0.9ms 0.7ms 0.9ms 21.5ms 🥇
Hash Map Lookup 0.077s 0.059s 0.072s 0.095s 🥇
Binary Trees 1.107s 0.971s 2.061s 0.963s 🥈
Fibonacci 0.705s 0.707s 1.341s 2.620s 🥈
File I/O 0.074s 0.080s 0.082s 0.141s 🥈
JSON Parse/Stringify 0.028s 0.041s 0.123s 0.099s 🥈
Monte Carlo Pi 0.341s 0.348s 0.355s 2.014s 🥈
N-Body Simulation 1.382s 1.746s 1.776s 1.878s 🥈
Regex Match 0.013s 0.004s 0.017s 0.003s 🥈
SQLite 0.031s 0.266s 0.342s 0.320s 🥈
Quicksort 0.190s 0.218s 0.188s 0.225s 🥉
Sieve of Eratosthenes 0.011s 0.021s 0.016s 0.033s 🥉
String Manipulation 0.006s 0.014s 0.013s 0.031s 🥉
Matrix Multiply 0.396s 0.552s 0.410s 0.335s #4

CLI Tool Benchmarks

Benchmark ChadScript grep node xxd Place
Hex Dump 0.476s 0.793s 0.108s 🥈
Recursive Grep 0.018s 0.009s 0.084s 🥈

@cs01 cs01 force-pushed the refactor/typed-ast-va branch from 9536bb5 to 03cb402 Compare April 20, 2026 14:02
@cs01 cs01 merged commit 74739e2 into main Apr 20, 2026
13 checks passed
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