ciathefed/nyx
64-bit register based VM written in Zig
master
5aad02aed585bd791c2592e1979417428a055ec4
64-bit register-based virtual machine and compiler written in Zig. Nyx supports compiling a simple assembly-like language into bytecode and executing it on a custom VM.
WARNING Nyx is in very early development. It is incomplete, lightly tested, and many features are missing. Expect breaking changes and unstable behavior.
Clone the repo and build:
git clone https://github.com/ciathefed/nyx.git
cd nyx
zig build -Doptimize=ReleaseFast
This will create the binary at zig-out/bin/nyx
.
nyx build examples/hello.nyx -o hello.nyb
nyx run examples/hello.nyx
You can also specify memory size (default is 65536 bytes):
nyx run examples/hello.nyx --mem 8192
nyx execute hello.nyb
With a custom memory size:
nyx execute hello.nyb --mem 16384
.section text
_start:
mov q0, 1
mov q1, message
mov q2, 14
mov q15, 3
syscall
hlt
.section data
message:
db "Hello, world!\n", 0x00
Contributions are welcome. If you find a bug or want to add a feature, open an issue or pull request.
To contribute code:
Please follow the Conventional Commits format for commit messages. Examples:
fix: handle empty source input in reporter
feat: add support for multiple source files
refactor: simplify diagnostic builder
Keep changes focused and minimal. Include tests when appropriate.
This project is licensed under the MIT License