C8a: decompose wasm.py into wasm/ package#120
Merged
Conversation
Split the 2,344-line wasm.py monolith into a vera/wasm/ package with 7 submodules using the same mixin-based pattern as the checker/ package. Package layout: __init__.py (6 lines) — re-exports 4 public API symbols helpers.py (211 lines) — WasmSlotEnv, StringPool, module-level helpers context.py (369 lines) — composed WasmContext class + dispatcher inference.py (527 lines) — InferenceMixin: type inference + utilities operators.py (430 lines) — OperatorsMixin: binary/unary ops, control flow calls.py (223 lines) — CallsMixin: function calls, effect handlers closures.py (248 lines) — ClosuresMixin: closures, free-var analysis data.py (460 lines) — DataMixin: constructors, match, arrays No test changes. All 951 tests pass, mypy clean, all 14 examples pass. Co-Authored-By: Claude <noreply@anthropic.invalid>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
wasm.pymonolith into avera/wasm/package with 7 submodulesInferenceMixin,OperatorsMixin,CallsMixin,ClosuresMixin,DataMixin) composed intoWasmContextvia multiple inheritancehelpers.pyto avoid circular imports__init__.pyCloses #100
Test plan
pytest tests/ -q)mypy vera/)python scripts/check_examples.py)python scripts/check_spec_examples.py)python scripts/check_readme_examples.py)python scripts/check_version_sync.py)🤖 Generated with Claude Code