get println from std::io
get len from std
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
| Repo | Description |
|---|---|
| rl-lang | The language itself: interpreter, stdlib, CLI, C transpiler, REPL, LSP, and docs |
| the-book | The official language reference and documentation |
| e-rl | rl-lang for embedded systems |
| Repo | Description |
|---|---|
| rl-setup | Install the RL toolchain in CI. Base action the rest build on |
| rl-check | Type-check RL sources in CI |
| rl-test | Run the RL test runner in CI |
| rl-transpile | Transpile RL to C in CI |
| rl-format | Enforce rl format style in CI |
| rl-package | Build distributable RL binaries in CI |
| Repo | Description |
|---|---|
| vscode-rl-lang | Full VS Code support: highlighting, LSP, run/check/format/package commands |
| rl-zed-extension | RL support for Zed: tree-sitter highlighting plus rlsp diagnostics |
| rl-textmate | Canonical TextMate grammar (.rl) shared by VS Code, JetBrains, and Linguist |
| tree-sitter-rl | Tree-sitter grammar for Helix, Neovim, Zed, and more |
| Repo | Description |
|---|---|
| rlos | Bootable Linux userspace experiment running RL programs as PID-1-and-up |
| core-utils | Unix core utilities reimplemented in RL |
| Repo | Description |
|---|---|
| rl-examples | Small RL programs too focused for their own repo |
| rlchase | Terminal maze-chase game built in RL |
| dsl-html | HTML and CSS static site generator written in RL |
| rl-website | The rl-lang landing page, written in RL |
| Repo | Description |
|---|---|
| .github | Org profile, templates, and shared workflows (this repo) |
| Repo | Description |
|---|---|
| rl-pack-linux | Linux packaging: deb, rpm, AUR, Gentoo, Nix, Snap, Flatpak |
| homebrew-rl | Homebrew tap: brew tap rl-lang/rl && brew install rl-lang |
| rl-pack-windows | Windows packaging: Chocolatey and WinGet |
Prebuilt binaries ship with every release:
curl -fsSL https://raw.githubusercontent.com/rl-lang/rl-lang/main/install.sh -o install.sh
bash install.shMIT or Apache 2.0 at your option.