https://github.com/janbaig/bytecode-virtual-machine
Implementing A Bytecode Virtual Machine
https://github.com/janbaig/bytecode-virtual-machine
bytecode-compiler interpreter virtual-machine
Last synced: 4 months ago
JSON representation
Implementing A Bytecode Virtual Machine
- Host: GitHub
- URL: https://github.com/janbaig/bytecode-virtual-machine
- Owner: janbaig
- Created: 2022-11-20T01:17:38.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-01T13:12:56.000Z (almost 2 years ago)
- Last Synced: 2025-01-16T21:50:46.974Z (6 months ago)
- Topics: bytecode-compiler, interpreter, virtual-machine
- Language: C
- Homepage:
- Size: 91.8 KB
- Stars: 1
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bytecode-Virtual-Machine
A Bytecode Virtual Machine (VM) written in `C`. To avoid the overhead of traversing an AST, a bytecode representation is introduced. The `scanner` outputs tokens which are later given as input to the `compiler` to generate bytecode - similar to assembly code although magnitudes simpler with a limited set of instructions. The generated bytecode is later given as input to the `VM` that then executes and displays the output.
## Challenges Completed
- [x] Chapter 14 - Chunks of Bytecode
- [x] Chapter 15 - A Virtual Machine
- [ ] Chapter 16 - Scanning on Demand
- [ ] Chapter 17 - Compiling Expressions
- [ ] Chapter 18 - Types of ValuesAll solutions can be found in the `./challenges` folder
## Potential Improvements to Solutions
- [ ] (Chp15/#4) - Look into ways to more accurately measure performance. How is the memory/CPU affected?
- [ ] (Chp16/#1) - Understand how [Wren](https://github.com/wren-lang/wren/tree/8fae8e4f1e490888e2cc9b2ea6b8e0d0ff9dd60f) and other languages interpret string interpolations. Maybe add support for it later on.