Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## [release] — 2026-03-23
- Prepared `v0.1.0` release candidate assets and docs.
- Audited syntax documentation against current parser/runtime behavior.
- Added root `RELEASE.md` covering `v0.0.1-pre` through `v0.1.0`.
- Added packaged release folder:
- `releases/0.1.0/rey-v0-macos-arm64`
- `releases/0.1.0/RELEASE.md`
- Bumped compiler crate version to `0.1.0` in `compiler/v1/Cargo.toml`.
- Updated README current version and import-system feature status.
- Cleaned compiler warnings (unused imports/variables/dead methods) and restored import parsing regression for `module::item`.
- Fixed static call parser bug so `StructName.create(...)` resolves method names correctly.
- Updated stale test fixture `compiler/v1/src/tests/test_rand.rey` to reflect current type checking behavior.

## [feature] — 2026-03-23
- Implemented full import system for Rey with compile-time resolution.
- Added `export pub` function modifier and import visibility enforcement:
Expand Down
16 changes: 12 additions & 4 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
## Core Rules

1. Variables are declared using `var`
2. The language is dynamic by default
2. Type annotations are optional; unannotated values are inferred
3. Type annotations are optional
4. If a type is specified, it is enforced at compile time
5. If no type is specified, the compiler infers it and may emit warnings
5. If no type is specified, the compiler infers it from the initializer
6. Once a type is specified, it cannot change
7. Rey is designed to be simple and easy to learn

Expand Down Expand Up @@ -62,9 +62,9 @@ From the codebase and CONTRIBUTING.md:

## My role as contributor

- I am Claude, a contributor on this project. My branch is `claude`. Misbah owns `main`.
- I am a contributor on this project. My working branch is `codex`. Misbah owns `main`.
- I never touch `main` or push to it directly.
- I commit my work to `claude` and open PRs to `main` when I have something meaningful.
- I commit my work to the contributor branch and open PRs to `main` when work is meaningful and verified.
- I use judgment on PRs — small fixes just get committed, feature-complete work gets a PR.
- I maintain `primer.md` every session — rewrite it at session start from git log + context, update it at session end.
- I update this `CLAUDE.md` when the project meaningfully evolves.
Expand All @@ -73,3 +73,11 @@ From the codebase and CONTRIBUTING.md:
- I never rewrite entire files for small fixes.
- I never delete files without asking.
- At the Start of every session, instead of going through the code, i'll go through CLAUDE.md, primer.md and other readme files to get context

## v0.1.0 snapshot

- Full import system is implemented:
- `export pub` for importable function exports
- file and module import syntax
- compile-time import resolver with visibility checks
- Language/runtime includes enums, match, structs, tuples, lambdas, `instanceof`, nullable and union type annotations.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func main(): Void {

## Status

Rey is under active development. Current version: **v0.0.7-pre**
Rey is under active development. Current version: **v0.1.0**

| Feature | Status |
|---------|--------|
Expand All @@ -73,7 +73,7 @@ Rey is under active development. Current version: **v0.0.7-pre**
| Structs | ✅ Done |
| String interpolation | ✅ Done |
| Error messages | ✅ Done |
| Import system | 🔨 In progress |
| Import system | ✅ Done |
| Standard library | 🔨 In progress |
| Package manager (reyc) | 📅 Planned |
| LLVM backend | 📅 Planned |
Expand Down Expand Up @@ -142,4 +142,4 @@ MIT — see [LICENSE](./LICENSE).

---

*Built by [@IMisbahk](https://github.com/IMisbahk) and contributors.*
*Built by [@IMisbahk](https://github.com/IMisbahk) and contributors.*
73 changes: 73 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# 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
2 changes: 1 addition & 1 deletion compiler/v1/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rey-v0"
version = "0.0.7"
version = "0.1.0"
edition = "2021"

description = "Rey v0 reference interpreter"
Expand Down
3 changes: 1 addition & 2 deletions compiler/v1/src/ast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ pub mod ty;
pub use expr::Expr;
pub use literal::Literal;
pub use stmt::{
FieldDecl, ForIterator, FunctionVisibility, ImportKind, MatchArm, MethodDecl, Parameter,
Pattern, Stmt,
FieldDecl, FunctionVisibility, ImportKind, MethodDecl, Parameter, Pattern, Stmt,
};
pub use ty::Type;
3 changes: 0 additions & 3 deletions compiler/v1/src/interpreter/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,4 @@ impl Environment {
self.struct_defs.get(name)
}

pub fn get_enum(&self, name: &str) -> Option<&Vec<String>> {
self.enum_defs.get(name)
}
}
31 changes: 8 additions & 23 deletions compiler/v1/src/parser/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#![allow(non_snake_case)]

use crate::ast::{
Expr, FieldDecl, FunctionVisibility, ImportKind, Literal, MatchArm, MethodDecl, Parameter,
Pattern, Stmt, Type,
Expr, FieldDecl, FunctionVisibility, ImportKind, Literal, MethodDecl, Parameter, Pattern,
Stmt, Type,
};
use crate::lexer::{span::Span, Token, TokenKind};
use crate::parser::error::ParserError;
Expand Down Expand Up @@ -346,7 +346,7 @@ impl Parser {
vec![symbol]
};
ImportKind::FileSymbols { module, symbols }
} else if self.matchDoubleColon() {
} else if self.matchToken(&TokenKind::ColonColon) {
let items = if self.matchToken(&TokenKind::LeftBrace) {
let mut values = Vec::new();
loop {
Expand Down Expand Up @@ -472,7 +472,7 @@ impl Parser {
}

fn parseMatchStatement(&mut self) -> Result<Stmt, ParserError> {
use crate::ast::stmt::{MatchArm, Pattern};
use crate::ast::stmt::MatchArm;

let expr = self.parseExpression()?;

Expand Down Expand Up @@ -785,7 +785,7 @@ impl Parser {
}

if self.matchToken(&TokenKind::Dot) {
let name = match &self.peek().kind {
let member_name = match &self.peek().kind {
TokenKind::Identifier(name) => name.clone(),
TokenKind::NumberLiteral(n) => {
if n.fract() != 0.0 {
Expand Down Expand Up @@ -822,7 +822,7 @@ impl Parser {
{
expr = Expr::StaticCall {
struct_name: struct_name.clone(),
method: name.clone(),
method: member_name.clone(),
args,
span: self.previous().span,
};
Expand All @@ -831,15 +831,15 @@ impl Parser {
}
expr = Expr::MethodCall {
receiver: Box::new(expr),
name,
name: member_name,
args,
span: self.previous().span,
};
continue;
}
expr = Expr::Get {
object: Box::new(expr),
name,
name: member_name,
span: self.previous().span,
};
continue;
Expand Down Expand Up @@ -1399,21 +1399,6 @@ impl Parser {
false
}
}

fn matchDoubleColon(&mut self) -> bool {
if self.check(&TokenKind::Colon)
&& self
.tokens
.get(self.current + 1)
.is_some_and(|token| matches!(token.kind, TokenKind::Colon))
{
self.advance();
self.advance();
true
} else {
false
}
}
fn consume(&mut self, kind: &TokenKind, message: &str) -> Result<(), ParserError> {
if self.check(kind) {
self.advance();
Expand Down
5 changes: 2 additions & 3 deletions compiler/v1/src/tests/test_rand.rey
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
func main () {
var name = "Misbah";
println("Hello, {name}");
name = 10;
name = name + "!";
println(name);

}
}
24 changes: 4 additions & 20 deletions compiler/v1/src/typecheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -534,9 +534,9 @@ impl TypeChecker {
Ok(())
}
Stmt::StructDecl {
name,
fields,
methods,
name: _,
fields: _,
methods: _,
} => {
// Structs bypass type checking for now
Ok(())
Expand Down Expand Up @@ -1235,22 +1235,6 @@ impl TypeChecker {
}
}

fn literalTy(&self, lit: &Literal) -> Ty {
match lit {
Literal::String(_) => Ty::String,
Literal::Char(_) => Ty::Char,
Literal::Bool(_) => Ty::Bool,
Literal::Null => Ty::Null,
Literal::Number(n) => {
if n.fract() == 0.0 {
Ty::Int
} else {
Ty::Float
}
}
}
}

fn join(&self, a: &Ty, b: &Ty) -> Ty {
if a == &Ty::Any {
return b.clone();
Expand All @@ -1275,7 +1259,7 @@ impl TypeChecker {

if matches!((a, b), (Ty::Union(_), _) | (_, Ty::Union(_))) {
let mut out = Vec::new();
let mut pushUnique = |t: Ty, out: &mut Vec<Ty>| {
let pushUnique = |t: Ty, out: &mut Vec<Ty>| {
if !out.iter().any(|x| x == &t) {
out.push(t);
}
Expand Down
Loading
Loading