martazvch/ray
Statically typed interpreted language designed to balance safety, clarity, and efficiency.
refsRay is a statically typed, interpreted language that aims for the sweet spot between safety and efficiency.
It focuses on clarity, robustness, and runtime performance, while keeping syntax expressive and lightweight.
Ray is implemented in Zig and runs on its own stack-based virtual machine with a mark-and-sweep garbage collector.
Ray brings together ideas from the languages I admire most.
It’s heavily inspired by Rust and Zig syntaxes, yet remains interpreted, making it easy to use, easy to embed, and simple to learn.
While its primary goal is to serve as an embeddable scripting language, Ray is general-purpose and flexible enough for standalone programs — especially thanks to its native C and Zig interop.
T!ErrorType? — explicit handling of optional values and fallback valueswhen expressions for type based pattern matching and match for value matchingA work-in-progress specification describes the current syntax, semantics, and design goals of the language.
To build Ray you need Zig compiler version 0.15.2.
Clone the repo and run:
git clone https://github.com/martazvch/ray.git
cd ray
zig build -Doptimize=ReleaseFast
I try to cover the maximum errors/use case as possible by testing each individual stage of the pipeline: Ast generation, Analyzer IR output, compiled bytecode and then VM's runtime behavior. You can find them in the tests folder.
To run them, run:
zig build test -Dtest-mode -Dstress-gc