Repository navigation
Use the stdlib Hashtbl for the compiler's hash tables - #8786
Conversation
simple_beta_reduce sequenced the unused arguments in the iteration order of its parameter hash table; fold over the parameters instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io>
Hash_ident, Hash_int, Lam_module_ident.Hash and the polyvar match table are now Hashtbl.Make instances; the ext Hash module is removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io>
rescript
@rescript/belt
@rescript/darwin-arm64
@rescript/darwin-x64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
|
Developer playground preview: https://rescript-lang.github.io/rescript/dev-playground/?version=pr-8786 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8786 +/- ##
==========================================
- Coverage 80.66% 80.66% -0.01%
==========================================
Files 463 461 -2
Lines 62792 62630 -162
==========================================
- Hits 50651 50520 -131
+ Misses 12141 12110 -31
🚀 New features to boost your workflow:
|
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…8786) * Evaluate unused arguments of inlined calls in parameter order simple_beta_reduce sequenced the unused arguments in the iteration order of its parameter hash table; fold over the parameters instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io> * Use the stdlib Hashtbl for the compiler's hash tables Hash_ident, Hash_int, Lam_module_ident.Hash and the polyvar match table are now Hashtbl.Make instances; the ext Hash module is removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io> * Add PR link to CHANGELOG Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io> * Reword CHANGELOG entry Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io> --------- Signed-off-by: Christoph Knittel <ck@cca.io> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Pedro Castro <aspeddro@gmail.com>
First of four PRs moving the compiler's own collections onto the OCaml standard library. This one covers hash tables.
Hash_ident,Hash_int,Lam_module_ident.Hashand the polymorphic-variant match table inPolyvar_pattern_matchare nowHashtbl.Makeinstances with the same equality and hash functions. The module names stay, so the types are still shared across the compiler; call sites use the stdlib API.HashandHash_genare removed.Changes beyond the API rename:
Lam_compile_envusedfind_key_optto reuse the id a JS module was first bound to. The stdlib has no such lookup, so theExternalentry now carries that id.Lam_beta_reduce_util.simple_beta_reducesequenced unused arguments in the hash table's iteration order, so a different table would have changed the output. It now folds over the parameters. This is also a small bug fix (separate commit): forf(log(1), log(2), log(3), log(4))with only the last parameter used, the unused arguments ran as 2, 3, 1 before and now run as 1, 2, 3. The newinline_unused_arg_order_testchecks this at runtime. A used argument is still substituted into the body, so it runs after the unused ones, as before.Hashimplementation are dropped.Output: apart from the evaluation-order fix, the generated JS and diagnostics are byte-identical to master on 627 files (Belt, all of
tests/tests/src, and the benchmark stress inputs).Performance: neutral (CPU +0.5%, allocation −0.1% vs master, within noise on a shared machine). The motivation is less code to maintain, not speed.
🤖 Generated with Claude Code