Website: https://valarpirai.github.io/aether/ | Crate: aether-lang on crates.io | Docs: Language Reference · Developer Docs
A general-purpose, dynamically typed programming language implemented in Rust — a fully-working tree-walking interpreter with a rich standard library, async I/O, structs, and a module system.
| Area | What's included |
|---|---|
| Types | int, float, string, bool, null, array, dict, set |
| Operators | arithmetic, comparison, logical, bitwise & | ^ ~ << >>, power **, ternary ?:, null coalesce ??, optional chain ?. |
| Functions | declarations, expressions, closures, optional params, recursion |
| Strings | interpolation "Hello ${name}", indexing, slicing, upper/lower/trim/split |
| Collections | array (push/pop/sort/slice/spread), dict (keys/values/contains), set (union/intersection/difference) |
| Pattern matching | match with literals, wildcards _, bind, enum variants, or-patterns | |
| Destructuring | let [a, b, ...rest] = arr, let {host, port: p = 5432} = dict |
| Error handling | try/catch/throw with e.message and e.stack_trace |
| Modules | import mod, from mod import fn, import mod as alias |
| Structs | fields, methods, self binding |
| Async/await | async fn, await, Promise.all, Promise.race, Promise.allSettled, I/O thread pool |
| Null safety | ?? null coalescing, ?. optional chaining |
| Standard library | 70+ functions: range, map, filter, reduce, math, string, testing and more |
| Tooling | aether fmt formatter, aether test runner, aether check linter |
| REPL | history, tab-completion, multi-line input |
cargo install aether-lang
aether --version # aether 0.2.0git clone https://github.com/valarpirai/aether.git
cd aether
cargo build --release
./target/release/aether --versionCreate hello.ae:
fn main() {
let name = "Aether"
println("Hello, ${name}!")
let numbers = range(1, 6)
let squares = map(numbers, fn(x) { return x * x })
println("Squares:", squares) // [1, 4, 9, 16, 25]
}
Run it:
aether hello.aelet x = 42
let pi = 3.14
let name = "Alice"
let active = true
let nothing = null
fn add(a, b) {
return a + b
}
let multiply = fn(a, b) { return a * b }
fn make_adder(n) {
return fn(x) { return x + n }
}
let add5 = make_adder(5)
println(add5(3)) // 8
let arr = [1, 2, 3]
arr.push(4)
println(arr.len()) // 4
let d = {"key": "value", "count": 42}
println(d["key"]) // value
let s = set([1, 2, 2, 3])
println(s) // {1, 2, 3}
// if / else
if (x > 0) {
println("positive")
} else if (x < 0) {
println("negative")
} else {
println("zero")
}
// for loop
for item in arr {
println(item)
}
// match
match status {
"ok" => println("success")
"err" => println("failed")
_ => println("unknown")
}
fn divide(a, b) {
if (b == 0) { throw "division by zero" }
return a / b
}
try {
println(divide(10, 0))
} catch(e) {
println("Error:", e.message)
println(e.stack_trace)
}
struct Point {
x
y
fn distance() {
return sqrt(self.x * self.x + self.y * self.y)
}
}
let p = Point { x: 3, y: 4 }
println(p.distance()) // 5.0
async fn fetch(url) {
let body = await http_get(url)
return json_parse(body)
}
fn main() {
set_workers(4)
let data = await fetch("https://api.example.com/data")
println(data)
}
import math
from testing import test, assert_eq, test_summary
fn main() {
let results = []
results.push(test("sin", fn() {
assert_eq(math.sin(0), 0)
}))
test_summary(results)
}
aether # Start interactive REPL
aether <file.ae> # Run a script
aether fmt [--check] <file> # Format source (--check: exit 1 if unformatted)
aether test [dir|file] # Discover and run *_test.ae files
aether check <file> # Lint for undefined variables
aether --version # Print version
aether --help # Print help
>> let x = 10
>> x * 2
20
>> fn greet(name) {
.. return "Hello, " + name
.. }
>> greet("World")
Hello, World
>> _help # show commands
>> _env # show bindings
>> _exit # quit (or Ctrl+D)
Multi-line blocks continue automatically with .. . Press Ctrl+C to cancel.
aether fmt myfile.ae # format in place
aether fmt --check myfile.ae # CI-safe check (exit 1 if not canonical)Write test files named *_test.ae using the testing stdlib module:
from testing import test, assert_eq, test_summary
fn main() {
let results = []
results.push(test("addition", fn() {
assert_eq(1 + 2, 3)
}))
test_summary(results)
}
Run them:
aether test # discover all *_test.ae in current dir
aether test examples/ # run tests in a specific directory
aether test examples/math_test.ae # run a single fileaether check myfile.ae
# myfile.ae: ok (exit 0)
# myfile.ae:12: undefined variable 'resutls' (exit 1)| Module | Functions |
|---|---|
| Core | range(), enumerate() |
| Collections | map(), filter(), reduce(), find(), every(), some(), sort(), concat(), zip(), flatten(), flat_map(), take(), drop(), chunk(), partition(), uniq(), uniq_by(), group_by(), count_by(), zip_longest(), first(), last() |
| Math | abs(), min(), max(), sum(), clamp(), sign(), floor(), ceil(), round(), sqrt(), pow(), log(), exp(), sin(), cos(), tan(), degrees(), radians(), hypot(), factorial(), gcd(), lcm(), pi, e, tau |
| String | join(), repeat(), reverse(), starts_with(), ends_with(), contains(), index_of(), replace(), count(), pad_left(), pad_right(), strip_prefix(), strip_suffix(), is_alpha(), is_digit(), is_space() |
| Testing | test(), test_summary(), assert_eq(), assert_true(), assert_false(), assert_null(), assert_not_null(), expect_error() |
Built-in functions also include: len(), type(), str(), int(), float(), bool(), print(), println(), input(), clock(), sleep(), json_parse(), json_stringify(), http_get(), http_post(), read_file(), write_file(), and more.
| Document | Description |
|---|---|
| Strings | Literals, indexing, slicing, interpolation, methods |
| Destructuring | Array and dict destructuring, rest, rename, defaults |
| Structs | User-defined types with fields and methods |
| Error Handling | try/catch/throw with stack traces |
| Async | async fn, await, Promise combinators, I/O pool |
| Iterators | Iterator protocol and built-in iterators |
| Module System | import, from…import, stdlib modules |
| Standard Library | Full stdlib reference |
| HTTP | http_get(), http_post() |
| JSON | json_parse(), json_stringify() |
| REPL | Interactive REPL and multi-line input |
| Configuration | Env vars and runtime knobs |
| Document | Description |
|---|---|
| Architecture | System design and roadmap |
| Design | Complete language specification |
| Development Guide | TDD workflow, post-feature checklist |
| Testing Guide | Running tests, writing integration tests |
| Memory Management | Rc-based GC and design rationale |
| Backlog | Prioritised feature backlog |
Version: 0.2.0 — tooling milestone complete
- ~1112 tests passing (134 unit + ~978 integration)
cargo clippyclean- Published on crates.io
- Enable the pre-commit hook:
git config core.hooksPath .githooks - Follow the Development Guide
- Write tests first (TDD)
- Run
cargo fmt && cargo clippy && cargo test -- --test-threads=1before committing
MIT — see LICENSE for details.