A small, fast scripting language, implemented from scratch in Rust. Helix compiles source to bytecode and runs it on its own stack machine — no tree-walking interpreter, no parser generator, no external runtime.
The aim is a language that stays out of the way: light enough to drop into a Rust program, quick enough not to think about, and predictable in the places scripting languages usually aren't.
........................................................................
......................................-======-......................................
:::::::::::::::::::::::::::::::::::+*######****+=:::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::--+###%%%%###****++-:::::::::::::::::::::::::::::::::
--::::::-----::-------::--------+*##%%%%%%##*****++=---:--------::-----::::::----:::
---------:----------:----------+***#%%%%%%#******++=------:---------::---------::---
:::---------::::--------------=*****#####********+==---++***+=------------::::------
--::::---------:::::--=====----++++*******++****+==---.*#%%#***======---------------
==----:-----======---------=====+++++++++++++++==----..+#%##***+=---------=====-----
=======----------======**++=----==============-------..=+++++++=----========--------
----==---------------#%%%##*+---------------------:....:=====--:::---==-------------
--==========--------*#%%##**+===---::::::::::::::.... ..:::::....:=====-----------=
===========---------+*****+==---::-=--.................--=-----===========-=======--
-------============--=====---.....====++=-::::::::::--===========-----------========
-----============------::::..---=+++++++++------------=++++++++====------------=====
==-=========================-=======================================-===============
=-------------=+++++++++++++--------------+++++++++++++=--------------++++++++++====
-------------++++++++++++++---------------++++++++++++++=--------------=++++++++++++
-----------=++++++++++++++=---------------+++++++++++++++=---------------=++++++++++
=========-================================================-===============+=========
+++++++=-----------------+++++++++++++++++-----------------++++++++++++++++=--------
++++++=-----------------=+++++++++++++++++------------------+++++++++++++++++=------
++++==-----------------=++++++++++++++++++------------------=+++++++++++++++++=-----
A raytracer — perspective camera, Blinn-Phong shading, hard shadows, a checkerboard plane and
distance fog — written entirely in Helix. Source in examples/raytracer/.
The cast loop never asks what shape it is holding; every object just answers ray_intersection:
fn Scene:cast_ray(self, ray, t_min, t_max) {
let closest = .none;
for object in self:objects {
match object:ray_intersection(ray, t_min, t_max) {
case (.some, hit): {
# shrink the window, so a later object only counts if it is nearer
t_max = hit:t;
closest = (.some, hit);
},
case _: {}
};
}
closest
}
Requires Rust and Cargo.
cargo run -- file.hx # execute a script
cargo run # start the REPL
cargo test # run the test suite
overview.md— a tour of the languagegrammar.md— the grammar, as the parser implements itexamples/— game of life, tic-tac-toe, pathfinding, sorting, the raytracerstd/— the standard library
v1.0. Complete enough to write real programs in.
Embedding is the direction rather than the current state. The host API is still compile-and-run, and the interner and source map are process-global, so a host gets one engine and scripts leak their source. Values are reference-counted, so cycles leak. Hash maps aren't in yet.
MIT