Help us shape the future of Go! Take the 2026 Go Developer Survey

rye

command module
v0.2.80 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2026 License: BSD-3-Clause Imports: 8 Imported by: 0

README

Rye language 🌾

Build and Test OpenSSF Scorecard Go Reference Go Report Card GitHub Release Homebrew

For comprehensive documentation, tutorials, and examples, visit ryelang.org

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: Beta - Core language design is stable, focus is on improving runtime, documentation, and usability.

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 factorial
range 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 read

For more examples and interactive demos, visit ryelang.org/meet_rye/

Building Rye from Source

Prerequisites
  1. Install Go 1.21.5 or later:
    # Example for Linux
    wget https://go.dev/dl/go1.21.5.linux-amd64.tar.gz
    rm -rf /usr/local/go && tar -C /usr/local -xzf go1.21.5.linux-amd64.tar.gz
    export PATH=$PATH:/usr/local/go/bin
    go version
    
Clone and Build
  1. Clone the repository:

    git clone https://github.com/refaktor/rye.git
    cd rye
    
  2. Build options:

    • Minimal build (fewer modules, smaller binary):

      go build -tags "b_tiny" -o bin/rye
      
    • Standard build (most modules included):

      go build -o bin/rye
      # or simply
      ./build
      
    • Custom build (select specific modules):

      go build -tags "b_tiny,b_sqlite,b_http,b_json" -o bin/rye
      
  3. Run Rye:

    # Run the REPL
    bin/rye
    
    # Run a script
    bin/rye script.rye
    
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
./buildwasm
# Then visit http://localhost:8085/ryeshell/
Running Tests
cd info
../bin/rye . test

# Generate function reference
../bin/rye . doc

Getting Rye (Pre-built)

If you prefer not to build from source, you have several options:

Binaries

Pre-compiled binaries for Linux, macOS, Windows, and WASM are available under Releases.

Package Managers
  • Homebrew (macOS/Linux):

    brew install ryelang
    
  • ArchLinux User Repository (Arch Linux):

    yay -S ryelang
    

Thanks to @kseistrup for Arch package and @stefanb for Homebrew.

Docker Images
  • Binary image (includes Rye and Emacs-nox):

    docker run -ti ghcr.io/refaktor/rye
    
  • Development image (build from repository):

    docker build -t refaktor/rye -f .docker/Dockerfile .
    docker run -ti refaktor/rye
    

Resources

Editor Support

Community and Contact

Thanks!

A big thanks to all contributors!

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package baseio provides the OS-level I/O builtins for Rye (file access, shell commands, stdin, os.Args, os.Exit), HTTP and the interactive terminal display builtins (display, explore, _.., explore\custom, print\ssv, print\csv).
Package baseio provides the OS-level I/O builtins for Rye (file access, shell commands, stdin, os.Args, os.Exit), HTTP and the interactive terminal display builtins (display, explore, _.., explore\custom, print\ssv, print\csv).
moved to evaldo/builtins_error_handling.go
moved to evaldo/builtins_error_handling.go
cmd
cato command
loop_benchmark command
rbit command
aws
mpv
embed module
embed2 module
object.go
object.go
builtins_error_handling.go
builtins_error_handling.go
internal
loader.go
loader.go
Package projectbuiltins is a reserved, empty-by-default package into which the local Rye builder (bin/l.rye) drops a project's own Go builtins.
Package projectbuiltins is a reserved, empty-by-default package into which the local Rye builder (bin/l.rye) drops a project's own Go builtins.
codesig.go - Code signature verification for Rye scripts
codesig.go - Code signature verification for Rye scripts
util.go
util.go
finder
Package finder extends go-find with result filters used by Rye's OS builtins.
Package finder extends go-find with result filters used by Rye's OS builtins.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL