Wasm compiler conductor integration and cleanup#149
Conversation
previously, type tags were stored as wasm global consts. this changes it them to be inlined consts instead
There was a problem hiding this comment.
Code Review
This pull request implements a shadow stack and a copying garbage collector within the WASM engine to manage complex types like lists and closures. It refactors the evaluator into chapter-specific classes and introduces a modular library system. Key updates include new WASM runtime helpers for memory management and type checking, alongside a refactored metacircular generator. Feedback points to a potential regression in error diagnostics due to the removal of BreakContinueError and questions the new restriction of for loops to range() in Python §4.
I am having trouble creating individual review comments. Click here to see my feedback.
src/resolver/errors.ts (74-86)
The BreakContinueError class has been removed. This could potentially lead to less specific error messages for misplaced break or continue statements. If the corresponding validator now throws a generic Error, it would be a regression in error reporting quality. Consider restoring a specific error class for this case to maintain detailed diagnostics.
src/validator/sublanguages.ts (62)
Adding ForRangeOnlyValidator to Python §4 seems to be a significant functional change, as it restricts for loops to only work with range(). Was this intentional? Python §4 is described as 'unrestricted', so this new restriction might be surprising.
References
- When referring to Python chapters, use the section symbol (§) for consistency with existing documentation (e.g., "Python §2" instead of "Python 2").
constants.tsinto theruntimefolderwasm-compiler.spec.tsinto thewasmfolderindex.tsBreakContinueOutsideLoopErrorWork that still needs to be done for wasm compiler:
reprfunction: it's wrong at the moment)builderGeneratorinto validators, since they should apply to all python implementations