The great frame refactor#2
Open
masak wants to merge 34 commits into
Open
Conversation
They will be added back, gradually.
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.
Old evaluator: Uses a
Konthierarchy to represent internal continuations. Evaluation always starts at a syntax node (and in some mode), but recursive evaluation is managed by delegating to aKontobject, in zero or more steps.New evaluator: Uses a single
Frameclass to unify the cases of "handling a node for the first time" and "continuing the node after a subtask finishes".Advantages:
infix.ts(~300 LoC) andpreifx.ts(~100 LoC); these have their own handler maps.Konttype.The properties of
Frameare divided into immutable and mutable. Here are the immutable ones:mode: Modenode: SyntaxNodestate: numberenv: EnvstaticEnvs: Map<SyntaxNode, Env>value: Valuecell: Cell | nulljumpMap: JumpMaptail: FrameHere are the mutable properties:
datum1: numberdatum2: number | Valuedatum3: Array<SyntaxNode>datum4: Array<Value>