Merged
Conversation
…layout - Parser: stop wrapping VariableDeclaration in Statement; add it to is_valid_statement so the parse loop continues - Compiler: split VariableDeclaration (push value only) from Assignment (push value + SetLocal + push unit); remove TODO comment - VM: start with empty stack instead of pushing the script function, fixing local slot 0 conflicts that corrupted all local variables - Tests: add test_declaration and test_assignment compiler tests
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- M1: extract compile_for_iterations helper, removing ~120 lines of duplicated loop scaffolding - M2: make VmIterator::deep_copy a required method; add missing impls for MinHeapIter, MaxHeapIter, StringIter - RD1: comment explaining synthetic unit push in no-else branch - RD2: remove dead `let memo =` binding in dispatch_call - RD3: descriptive panic messages in Closure opcode handling - RD4: rename max_local field to num_locals (matching its accessor) - Remove REVIEW.md (all actionable items resolved) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…() builtin Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ly-qualified Value paths - Rename match.rs → types.rs with unified NdcType enum and classify() function - Replace panics with syn::Error for proper compiler diagnostics - Remove dead #[function] stub, add arg_error() and refcell_collection_arg() helpers - Add module-level documentation to all macro crate files - Update stdlib to use short Value/Object/SeqValue/MapValue imports everywhere Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…n hot paths - Merge MinHeapIter/MaxHeapIter into single HeapIter - Merge List/Tuple unpack branches in VM - Combine RangeInclusive/RangeExclusive compiler arms - Inline vectorization_pairs into try_vectorized_call - Use &OpCode references in Chunk::iter() and disassembler - Cache Value::unit() via thread_local (9-16% faster on benchmarks) - Minor: fix parens, rename shadowed param, update ndc_macros for HeapIter Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…resolvers Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…inition error - Upvalues no longer short-circuit resolution: the scope walk continues to find exact matches for other overloads in parent scopes - add_upvalue deduplicates by name+source so multiple overloads of the same function get separate upvalue entries - Same-scope same-arity fn redefinition is now a compile error - 9 new tests for shadowing/overloading semantics - Updated manual with shadowing documentation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Function resolution now filters out bindings with known non-callable types (Int, String, etc.) from the dynamic fallback, turning confusing runtime errors into compile-time errors. Also tracks explicit `return` types via a stack so `return value;` correctly infers the function's return type instead of unit. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… Any return/break/continue now produce Never (bottom type) instead of unit. Statement propagates Never so blocks see that control doesn't fall through. This prevents `return 1;` from polluting the function's return type with unit via lub. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… upvalues Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1015041 to
5b1cd6d
Compare
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
Replaces the tree-walk interpreter with a bytecode-compiled stack-based VM as the single execution path (~192 commits).
Compiler & VM
OpCodesequenceif/while/for/break/continue/returnall compile to jump instructionsUnpackopcode+=, etc.) for identifiers, index expressions, and destructuringStdlib & dispatch
FunctionRegistry+vm_nativefield onFunctionfor bridge-free native dispatchmap,filter,fold,all,any, etc.) work with VM closuresInfrastructure
ndc_vmcrate with compiler and VMvm-tracefeature for source-annotated instruction tracingBenchmarks (v0.2.1 tree-walk vs VM)
🤖 Generated with Claude Code