A statically-typed interpreted language written in Rust with a clean syntax, a TUI REPL, and a growing standard library.
get println, len from std::io
get pow, mod, factorial, fibonacci, is_prime from std::math
get PI from std::math::consts
fn collatz(int n) {
dec int steps = 0
while (n != 1) {
if (mod(n, 2) == 0) {
n = n / 2
} else {
n = n * 3 + 1
}
steps += 1
}
return steps
}
println(factorial(10)) // 3628800
println(fibonacci(15)) // 610
println(is_prime(97)) // true
println(collatz(27)) // 111
dec float r = 5.0
println(PI() * pow(r, 2.0)) // 78.53981633974483
git clone https://github.com/rl-lang/rl-lang
cd rl-lang/crates/rl-cli
cargo build --release
# binary at target/release/rlcargo install rl-clifrom releases you can choose nightly builds or the latest build
Firstly i highly suggest using the docs command
rl docs
# for TUI mode
rl docs --tuifor using the compiled rl binary
# to check available commands
rl -h
# or
rl --help
# to start a new project
rl new example-project
# in project root you can run it via
rl dev
# or run the file directly
rl run src/main.rlFull language reference and stdlib documentation is available on the wiki.
- Install the rl-lang extension for syntax highlighting in
.rlfiles. - Install the rl-lang runner extension to run and check files from the editor.
- Install the rl-lang LSP extension for diagnostics and hover.
A Tree-sitter grammar is available at rl-lang/tree-sitter-rl for editors that support it (Neovim, Helix, Zed, etc.).
Criterion benchmarks live in crates/rl-benches. Run with:
cargo benchcargo test --all-features # full test suite
cargo clippy -- -D warnings # lints
cargo bench # criterion benchmarksFeature flags:
| Flag | State | Description |
|---|---|---|
run |
On by default |
- |
eval |
On by default |
This flag for actually running the code ( weather in interpreter or `vm ) |
vm |
On by default |
This flag for vm backend |
cranelift |
Off experimental |
This flag for cranelift backend used for native compilations |
repl |
On by default |
This flag for the interactive TUI shell REPL |
docs-tui |
On by default |
This flag for the interactive TUI mode for browsing rl-docs |
debug |
Off by default |
This flag for logging and debugging purposes |
lsp |
Off by default |
This flag for language server protocol used by IDEs and other editors |
Mohamed Gonem π» π π€ |
Flawlesscode π» |
Mustapha Boutoub π» |
RubyPaws39 π» |
Anirudh Patwal π» |
Naimish π» |
Licensed under either of MIT or Apache 2.0 at your option.