refaktor/rye
{ "createdAt": "2020-08-05T09:53:50Z", "defaultBranch": "main", "description": "a language trying to be flexible about expression, but strict about state", "fullName": "refaktor/rye", "homepage": "https://ryelang.org", "language": "Go", "name": "rye", "pushedAt": "2025-11-25T00:52:44Z", "stargazersCount": 627, "topics": [ "console", "factor", "golang", "programming-language", "rebol", "ryelang" ], "updatedAt": "2025-11-25T00:52:50Z", "url": "https://github.com/refaktor/rye"}Rye language 🌾
Section titled “Rye language 🌾”For comprehensive documentation, tutorials, and examples, visit ryelang.org
What is Rye?
Section titled “What is Rye?”Rye is a high-level, dynamic programming language inspired by Rebol, Factor, Linux shells, and Go. It features a Go-based interpreter and interactive console, making it an excellent scripting companion for Go programs. Rye can also be embedded into Go applications as a scripting or configuration language.
Key characteristics:
- Homoiconic: Code is data, data is code
- Function-oriented: No keywords, everything is a function call
- Expression-based: Everything returns a value
- First-class functions: Functions and code blocks are values
- Multiple dialects: Specialized interpreters for different tasks
- Safety-focused: Explicit state changes, pure/impure function separation, validation dialect
Status: Alpha - Core language design is stable, focus is on improving runtime, documentation, and usability.
Quick Examples
Section titled “Quick Examples”print "Hello World"
"Hello World" .replace "World" "Mars" |print; prints: Hello Mars
"12 8 12 16 8 6" .load .unique .sum; returns: 42
{ "Anne" "Joan" "Adam" } |filter { .first = "A" } |for { .print }; prints:; Anne; Adam
fac: fn { x } { either x = 1 { 1 } { x * fac x - 1 } }; function that calculates factorialrange 1 10 |map { .fac } |print\csv; prints: 1,2,6,24,120,720,5040,40320,362880,3628800
kind: "admin"Open sqlite://data.db |Query { select * from user where kind = ?kind }; returns: Table of admins
Read %name.txt |fix { "Anonymous" } |Post* https://example.com/postname 'text; makes HTTP post of the name read from a file, or "Anonymous" if file failed to be readFor more examples and interactive demos, visit ryelang.org/meet_rye/
Building Rye from Source
Section titled “Building Rye from Source”Prerequisites
Section titled “Prerequisites”- Install Go 1.21.5 or later:
Terminal window # Example for Linuxwget https://go.dev/dl/go1.21.5.linux-amd64.tar.gzrm -rf /usr/local/go && tar -C /usr/local -xzf go1.21.5.linux-amd64.tar.gzexport PATH=$PATH:/usr/local/go/bingo version
Clone and Build
Section titled “Clone and Build”-
Clone the repository:
Terminal window git clone https://github.com/refaktor/rye.gitcd rye -
Build options:
-
Minimal build (fewer modules, smaller binary):
Terminal window go build -tags "b_tiny" -o bin/rye -
Standard build (most modules included):
Terminal window go build -o bin/rye# or simply./build -
Custom build (select specific modules):
Terminal window go build -tags "b_tiny,b_sqlite,b_http,b_json" -o bin/rye
-
-
Run Rye:
Terminal window # Run the REPLbin/rye# Run a scriptbin/rye script.rye
Building WASM Version
Section titled “Building WASM Version”Rye can run in browsers and other WASM environments:
GOOS=js GOARCH=wasm go build -tags "b_tiny" -o wasm/rye.wasm main_wasm.go# or use the helper script./buildwasmRunning Tests
Section titled “Running Tests”cd info../bin/rye . test
# Generate function reference../bin/rye . docGetting Rye (Pre-built)
Section titled “Getting Rye (Pre-built)”If you prefer not to build from source, you have several options:
Binaries
Section titled “Binaries”Pre-compiled binaries for Linux, macOS, Windows, and WASM are available under Releases.
Package Managers
Section titled “Package Managers”-
Homebrew (macOS/Linux):
Terminal window brew install ryelang -
ArchLinux User Repository (Arch Linux):
Terminal window yay -S ryelang
Docker Images
Section titled “Docker Images”-
Binary image (includes Rye and Emacs-nox):
Terminal window docker run -ti ghcr.io/refaktor/rye -
Development image (build from repository):
Terminal window docker build -t refaktor/rye -f .docker/Dockerfile .docker run -ti refaktor/rye
Resources
Section titled “Resources”- ryelang.org - Official documentation, tutorials, and examples
- Blog - Latest updates and development news
- [Examples folder]!(./examples/) - Code examples and demos
- Asciinema demos - Interactive terminal demos
Extensions and Related Projects
Section titled “Extensions and Related Projects”- Rye-fyne - GUI toolkit binding
- Rye-gio - Gioui toolkit binding (WIP)
- Rye-ebitengine - 2D game engine binding (WIP)
- ryegen - Binding generation toolkit (WIP)
Editor Support
Section titled “Editor Support”- VS Code: Search for “ryelang” in the Extension marketplace repository
- Emacs: syntax highlighting
- NeoVIM: syntax highlighting
Community and Contact
Section titled “Community and Contact”- GitHub Discussions
- Issues
- Email: janko.itm+rye[at]gmail.com