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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## [tooling] — 2026-03-17
- Added Linguist submission prep files: `languages/Rey.yaml`, `languages/samples/Rey.rey`, `LINGUIST.md`

## [fix] — 2026-03-17
- Added array methods: `.length()` and `.push()`
- Allowed typed empty array assignment like `var xs: [int] = []`
Expand Down
39 changes: 39 additions & 0 deletions LINGUIST.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Rey — GitHub Linguist submission prep

This repo contains **Rey**, an experimental programming language and interpreter written in Rust.

This directory layout is intended to prepare a future PR to `github-linguist/linguist` so GitHub can recognize `.rey` files as the **Rey** language (syntax highlighting on GitHub, language stats, etc.).

## Repo links
- Rey language repo: https://github.com/rey-language/rey
- GitHub Linguist: https://github.com/github-linguist/linguist

## Proposed Linguist metadata
- `.gitattributes` marks `*.rey` as `linguist-language=Rey`
- `languages/Rey.yaml` contains the language definition (format mirrors Linguist language YAML entries)
- `languages/samples/Rey.rey` is a clean consolidated sample for tests/highlighting

## Sample sources
The sample is consolidated from existing test fixtures:
- `compiler/v1/src/tests/arrays.rey`
- `compiler/v1/src/tests/array_methods.rey`
- `compiler/v1/src/tests/functions.rey`
- `compiler/v1/src/tests/property_access.rey`
- `compiler/v1/src/tests/full_demo.rey`

## Sample code
```rey
// see languages/samples/Rey.rey for the full sample
func main(): Void {
var xs: [int] = [];
xs.push(1);
println(xs.length());
}
```

## How this maps to a future Linguist PR
In `github-linguist/linguist`, this would translate to:
- Adding `.rey` + metadata to Linguist’s language definitions
- Adding `languages/samples/Rey.rey` (or equivalent) as the sample used for detection/highlighting tests

This repo keeps the metadata and sample here to make the upstream PR straightforward.
7 changes: 7 additions & 0 deletions languages/Rey.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: Rey
type: programming
color: "#eb4c3b"
extensions:
- ".rey"
tm_scope: source.rey
ace_mode: text
37 changes: 37 additions & 0 deletions languages/samples/Rey.rey
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Rey sample for GitHub Linguist

func add(a: int, b: int): int {
return a + b;
}

func main(): Void {
// typed empty array + methods + builtins
var xs: [int] = [];
xs.push(1);
xs.push(2);
println(xs.length());
println(len(xs));

// dictionaries + property access
var user = {name: "Rey", id: 42};
if (user.id > 10) {
println("ok");
} else {
println("no");
}

// loops + range + break/continue
var sum: int = 0;
for i in range(1, 10) {
if (i == 3) { continue; }
if (i == 6) { break; }
sum = sum + i;
}
println(sum);

while (sum > 0) {
sum = sum - 1;
}

println(add(2, 3));
}
3 changes: 3 additions & 0 deletions primer.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,6 @@ Run any of them with cargo run -- src/tests/.rey
## For next session
- Consider tightening the language spec (what is int vs float at runtime, truthiness rules, dictionary key restrictions).
- Add negative tests for type errors once there's a harness for expected-failure cases.
- Submit upstream PRs:
- `github-linguist/linguist` for Rey language recognition
- VSCode Marketplace publish for `rey-vscode/` (optional)
Loading