Skip to content

module style 1: use compile context in more places - #326

Merged
prozacchiwawa merged 12 commits into
mainfrom
20260121-compile-context
Mar 10, 2026
Merged

prozacchiwawa merged 12 commits into
mainfrom
20260121-compile-context

Conversation

@prozacchiwawa

@prozacchiwawa prozacchiwawa commented Jan 22, 2026 •

Copy link
Copy Markdown
Contributor

Note

Medium Risk
Touches core compiler and evaluator plumbing by changing compile_program/REPL/shrinker APIs to share a mutable BasicCompileContext, which could subtly affect allocator/symbol/optimizer state across nested compiles and macro evaluation.

Overview
Refactors compilation entrypoints to use a shared BasicCompileContext. CompilerOpts::compile_program now takes &mut BasicCompileContext (instead of separate allocator/runner/symbol table), and call sites in codegen and optimizer are updated accordingly.

Threads compile context through evaluation/minification flows. The REPL, shrink tool, evaluator (shrink_bodyform + macro expansion), preprocessor macro compilation, and WASM REPL invocation now build/use a BasicCompileContext and obtain optimizers via get_optimizer, reducing ad-hoc allocator/symbol handling.

Also updates pyo3 module constructors to the newer Python<'_> signature and adjusts tests to the new context-based APIs.

Written by Cursor Bugbot for commit 1cd7de3. This will update automatically on new commits. Configure here.

@prozacchiwawa prozacchiwawa changed the title use compile context in more places module style 1: use compile context in more places Feb 13, 2026
@prozacchiwawa
prozacchiwawa marked this pull request as ready for review February 17, 2026 10:09
Comment thread src/compiler/compiler.rs Outdated
Comment thread src/compiler/preprocessor/mod.rs Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment thread src/compiler/mod.rs Outdated
@prozacchiwawa
prozacchiwawa merged commit 2b1e632 into main Mar 10, 2026
35 checks passed
@prozacchiwawa
prozacchiwawa deleted the 20260121-compile-context branch March 10, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants