Skip to content

New structure : VM bytecode and compiling#1

Merged
dedalien merged 9 commits into
devfrom
feat/compiler
Feb 18, 2026
Merged

New structure : VM bytecode and compiling#1
dedalien merged 9 commits into
devfrom
feat/compiler

Conversation

@dedalien

Copy link
Copy Markdown
Owner

Entirely terraformed this project with a more efficient structure : bytecode interpretation.

Previously, it was just AST-Walking. Created a stack-based VM in Go, make my AST compiles each node in bytecode recursively and so added execution of this bytecode.

Simple architecture but robust. Added a lot of tests to cover all the important parts.

Removed MATCHES operator for the moment, will add in a future release.
Also remade the negation and logical operators section. 🙃

BREAKING CHANGE: Replace AST evaluation with bytecode VM

- Add bytecode VM with stack-based architecture (~2μs execution time)
- Implement 18 opcodes (PUSH, LOAD_GLOBAL, OP_EQ, OP_IN, etc.)
- Support for int8/16/32, string, bool, and array types
- Optimized handlers using array lookup instead of switch
- Add Value.Compare() for unified comparisons
- Remove redundant opcodes (NEQ, NOT_CONTAINS) in favor of composition
- VM supports record loading and bytecode execution

Performance: ~10x faster at least than AST walking for repeated queries
Also refactored int and string with generic function
Enhanced AST and Parser with NOT support. Removed MATCHES Operator for this current version, will be implemented in further version.
Now use a vm with bytecode compilation and enhanced parser
@dedalien dedalien merged commit ebe9edc into dev Feb 18, 2026
1 check passed
@dedalien dedalien deleted the feat/compiler branch February 18, 2026 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant