| Crates.io | dash-lang |
| lib.rs | dash-lang |
| version | 0.2.0 |
| created_at | 2025-10-14 19:11:42.749382+00 |
| updated_at | 2025-10-15 14:55:53.560543+00 |
| description | A simple interpreted language |
| homepage | |
| repository | https://github.com/Pjdur/dash-lang |
| max_upload_size | |
| id | 1882945 |
| size | 30,789 |
Dash is a lightweight interpreted programming language written in Rust. It supports variables, arithmetic, control flow, functions, and return values — all powered by a custom grammar using Pest. Whether you're building a scripting engine, learning interpreters, or just having fun, Dash is a great place to start.
let x = 3 + 4)if, while, break, continue.dash filesgit clone https://github.com/Pjdur/dash-lang.git
cd dash
cargo run
This runs a default hardcoded script. To run a file:
cargo run -- examples/hello.dash
Or build and run:
cargo build --release
./target/release/Dash examples/hello.dash
let x = 3 + 4
print(x)
let x = 0
while x < 5 {
print(x)
let x = x + 1
}
if x > 10 {
print("big")
} else {
print("small")
}
fn add(a, b) {
return a + b
}
let result = add(5, 7)
print(result)
while x < 10 {
let x = x + 1
if x == 5 {
continue
}
if x == 8 {
break
}
print(x)
}
src/main.rs — Entry point and CLIlang.pest — Grammar definitionContext, Expr, Stmt, Op — Core AST and runtime structuresbuild_expr, build_stmt, exec_stmt, eval_expr — Parser and interpreter logicCreate a file like examples/hello.dash:
fn greet(name) {
print("Hello")
print(name)
}
greet("World")
Then run:
cargo run -- examples/hello.dash
All core functions and data structures are documented with Rust-style /// comments. You can generate docs with:
cargo doc --open
Pull requests are welcome! If you’d like to add features (booleans, arrays, REPL, etc.), improve error handling, or optimize performance, feel free to fork and submit a PR.
MIT License. See LICENSE for details.
Built with ❤️ using Rust and Pest. Inspired by classic interpreter designs and educational language projects.