Simplify runtime architecture: Interpreter becomes the running program#84
Merged
figgleforth merged 7 commits intomainfrom Apr 5, 2026
Merged
Simplify runtime architecture: Interpreter becomes the running program#84figgleforth merged 7 commits intomainfrom
figgleforth merged 7 commits intomainfrom
Conversation
- Removed Pipeline, Stage - Made Interpreter the main program with it's own instances of lexer, parser, runtime - Simplified Runtime - Update tests
Interpreter now has the methods that used to be in the Runtime class.
Runtime is both a scope and the main scope with the stack. It itself is the first scope in its stack. Weird? Maybe. Tests pass. This simplifies the mental model to just Interpreter and its subsystems.
The stack, server map, database map, etc, used to be in a class Runtime. Now that functionality is directly in Interpreter. Makes Interpreter the main running program. Don't have to think about calling .runtime anywhere. All tests pass.
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
Interpreteris now the sole entry point: it holds lexer, parser, and all execution state (stack, routes, servers, loaded_files, etc.) directly, and exposes run(source_code)Global < Scopegoes back to a plain empty subclass, and becomes the first scope pushed to stack on first runWhat changed
Before: Five moving parts —
Stage,Program,Runtime,Global,Interpreter— with circular ownership (Runtimeowned ~Interpreter,Interpreterheld@runtime`) and two separate code paths for interp vs interp_file.After: Three plain classes —
Lexer,Parser,Interpreter.Interpreter.new.run(source)is all a caller needs. Lexer and Parser can still be called directly for partial pipeline use.