Skip to content

Releases: rey-language/rey

v0.2.0

Choose a tag to compare

@IMisbahk IMisbahk released this 25 Apr 19:29

Rey v0.2.0 — Native Compiler (Self-Hosted)

Released: 2026-04-24
Platform: macOS arm64


What's in this release

rey-macos-arm64 is the native Rey compiler — compiled from Rey source code itself, without the Rust interpreter in the critical path.

This is the first release where the compiler is built from its own source (rey-compiler/main.rey) using the LLVM backend, producing real native binaries via clang.


How to use

# Build a Rey program
./rey-macos-arm64 <path/to/main.rey> build <your-program.rey>

# Run (compile + execute)
./rey-macos-arm64 <path/to/main.rey> run <your-program.rey>

The first argument is the compiler's own source path (used to locate the runtime library). For a clean setup, use the reyc launcher from the repo root which handles this automatically.


What changed since v0.1.0

LLVM backend (new)

A full LLVM IR emitter was added under rey-compiler/. Programs now compile to native machine code via:

.rey source → Lexer → Parser → LLVM IR emitter → clang → native binary

C runtime library

A C runtime (rey-compiler/runtime/) implements all heap operations:

  • Strings — heap-allocated, length-prefixed UTF-8 (rey_str_*)
  • Vec — dynamic arrays with push/pop/get/set/map/filter/join (rey_vec_*)
  • HashMap — string-keyed hash maps (rey_hm_*)
  • Result / Option — tagged union values (rey_ok, rey_err, rey_some, rey_none)
  • IOreadFile, writeFile, fileExists, listDir, exec
  • Processargs, exit, exec

Self-hosting

The compiler compiles itself. Phase H complete:

  • rey-compiler/main.rey compiled to native binary by rey-v0 (Rust bootstrap)
  • Native binary passes all e2e tests identically to the Rust-hosted compiler

Value representation

All Rey values are i64 in LLVM IR:

  • Scalars (int, bool, float) — stored directly
  • Heap values (String, Vec, HashMap, struct, Result, Option) — pointer cast to i64
  • Struct header: 16-byte prefix with a type tag byte for instanceof checks

Known limitations

  • macOS arm64 only — no Windows or Linux binary yet
  • No garbage collector — arena allocation, freed at process exit (correct for short-lived compiler processes)
  • No closures over mutable state — lambdas are lifted to top-level functions
  • Typechecker is a stub — type inference works but full static type checking is not enforced
  • Self-compile crashes — the native compiler can compile all e2e fixtures but panics on its own complex source (remaining type-annotation gaps in codegen)

Verified tests

All e2e fixtures pass under the native compiler:

Test Status
hello
math
loops
functions
structs
enums
strings
vec
collections
io
imports

Bootstrap chain

rey-v0 (Rust)  →  rey-compiler/main.rey  →  rey-macos-arm64

The Rust interpreter remains in the repo as a reference implementation and fallback. It is not required to run compiled programs.

v0.1.0

Choose a tag to compare

@IMisbahk IMisbahk released this 22 Mar 20:41
5b39ec5

Rey v0.1.0 Release Notes

v0.0.1-pre

  • Initial pre-release binary drop for Rey (rey-v0).
  • Established baseline language pipeline (lexer -> parser -> interpreter).
  • Early CLI workflow for running .rey files.

v0.0.2-pre

  • Stabilized core interpreter internals (environment/value/execution wiring).
  • Improved support for functions and control-flow execution.
  • Continued parser/executor iteration toward wider syntax coverage.

v0.0.3-pre

  • Added lexer support for // comments.
  • Hardened parser behavior and removed panic paths after lexer failures.
  • Synced and normalized compiler/v1/src/tests/ fixtures to current behavior.
  • Cleaned compiler warnings for that release milestone.

v0.0.4-pre

  • Added arrays: literals, indexing, typed arrays, and push/pop/len built-ins.
  • Added dictionaries: literals, indexing, typed dictionaries.
  • Added property access (obj.prop) for dictionary keys.
  • Added input() builtin and expanded string methods.
  • Added compile-time type enforcement for annotated values/calls.

v0.0.5-pre

  • Added string interpolation ("HP: {hp}") and mixed-type string concatenation.
  • Added print() and variadic-style println(...) behavior.
  • Added conversion methods: .toString(), .toInt(), .toFloat().
  • Added math built-ins: abs, max, min, random.
  • Added const declarations and upgraded diagnostic output style.

v0.0.6-pre

  • Shipped full struct system:
    • Struct declarations and literals
    • Instance/static-style methods
    • pub visibility metadata
    • Method overloading behavior in runtime dispatch
  • Improved struct field diagnostics with suggestion support.

v0.0.7-pre

  • Fixed else if chaining behavior.
  • Fixed struct field assignment behavior.
  • Fixed array index assignment behavior.
  • Fixed integer division behavior.
  • Added/solidified loop, for ... in array, enums, and match support in the v0.0.7 cycle.

v0.1.0

  • Implemented full import system with compile-time resolution.
  • Added export pub visibility for importable functions.
  • Added file-level imports:
    • import file.symbol
    • import file.{a, b}
  • Added module-level imports:
    • import module
    • import module::item
    • import module::{itemA, itemB}
  • Added deterministic resolver order:
    1. current file directory
    2. project root
    3. ~/.reyc/std/src
    4. ~/.reyc/packages
  • Added scope injection semantics for symbol and namespace imports.
  • Added import diagnostics for missing files/modules/symbols, non-exported symbols, circular imports, and duplicates.
  • Added import fixtures under tests/imports/ for success and failure scenarios.

What's Next (v0.2.0)

  • Enums are done.
  • Match is done.
  • Planned focus:
    • Generics
    • Better closure ergonomics and runtime semantics
    • Continued standard library and module ecosystem maturity

v-0.0.3-pre

v-0.0.3-pre Pre-release
Pre-release

Choose a tag to compare

@IMisbahk IMisbahk released this 17 Mar 14:59
2d3f62f
Merge pull request #21 from rey-language/codex

feat: implement all data types — rey v0.0.4-pre

v0.0.2-pre

v0.0.2-pre Pre-release
Pre-release

Choose a tag to compare

@IMisbahk IMisbahk released this 13 Jan 17:14
879ec9a

added more functionality to rust based precompiler

Rey v0.0.1-pre — Core Interpreter

Pre-release

Choose a tag to compare

@IMisbahk IMisbahk released this 27 Dec 14:14
586379c

This is the first pre-release of Rey.

Rey currently includes:

  • Lexer and parser
  • AST-based interpreter
  • Dynamic execution model
  • Variable declarations and expressions
  • Binary and unary operations
  • Scoped environments
  • Deterministic runtime errors

Not yet implemented:

  • Function calls and closures
  • Control flow (if/while)
  • Standard library
  • Type enforcement

Supported platforms:

  • macOS (Apple Silicon)
  • Windows (x86_64)

This release freezes the core architecture and marks the beginning of runtime development.

Installation (Pre-release)

Download the appropriate binary from the Releases page.

macOS

chmod +x rey-v0-macos-arm64
./rey-v0-macos-arm64 file.rey

###windows

rey-v0-windows-x86_64.exe file.rey