Rye language 🌾

visit ryelang.org, our blog or join our reddit group for latest examples and development updates
What is Rye
Rye is a high level, dynamic programming language based on ideas from Rebol, flavored by
Factor, Linux shells and Golang. It's still an experiment in language design, but it should slowly become more and
more useful in real world.
It features a Golang based interpreter and console and could also be seen as (modest) Golang's scripting companion as
Go's libraries are quite easy to integrate.
Status: Alpha
Core ideas of the language are formed. Most experimenting, at least for this stage is done.
Right now, focus is on making the core and runtime useful for anyone who might decide to try it.
This means we are improving the Rye console, documentation and improving the runtime and core functions.
Language overview
Rye is homoiconic, it has no keywords or special forms (everything is a function call), everything is an expression - returns something,
has more datatypes and more syntaxt types than your usual language, functions are "first class citisens", bo so is everything else, even
blocks of code and scopes (contexts). It has multiple dialects (specific interpreters).
Few one-liners
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
kind: "admin"
open sqlite://data.db |query { select * from user where kind = ?kind }
; returns a spreadsheet of admins
Meet Rye
Visit this set of pages to find out more (work in progress):
Examples
These pages are littered with examples. You can find them on this README page, on our blog, on Introductions, but also:
Rye vs. Python
Python is the lingua franca of dynamic programming languages so comparing examples in Python and Rye can be helpfull to some:
Modules
The author of Factor once said that at the end it's not about the language, but the libraries. I can only agree, adding libraries, and distribution.
Base
- Core builtin functions ⭐⭐⭐ 🧪~80%
- Bcrypt - password hashing
- Bson - binary (j)son
- Crypto - cryptographic functions ⭐
- Email - email generation and parsing
- Html - html parsing
- Http - http servers and clients ⭐⭐
- IO (!) - can be excluded at build time ⭐⭐
- Json - json parsing ⭐⭐
- Mysql - database ⭐
- Postgresql - database ⭐
- Psutil - linux process management
- Regexp - regular expressions ⭐ 🧪~50%
- Smtpd - smtp server (receiver)
- Sqlite - database ⭐⭐
- Sxml - sax XML like streaming dialect
- Validation - validation dialect ⭐⭐ 🧪~50%
- Webview - Webview GUI
Contrib modules
- Amazon AWS
- Bleve full text search
- Cayley graph database
- OpenAI - OpenAI API
- Postmark - email sending service
- Telegram bot - telegram bots
- Ebitengine - 2d game engine
legend: ⭐ priority , 🧪 tests
Follow development
Rye blog
For most up-to date information on the language and it's development visit our old and new blog.
Ryelang reddit
This is another place for updates and also potental discussions. You are welcome to join our reddit group.
Github
If code speaks to you, our Github page is the central location for all things Rye. You are welcome to collaborate, post Issues or PR-s, there is tons of things to do and improve :)
Getting Rye
Rye is developed on Linux, but has also been compiled on macOS, Docker and as WASM module. If you need additional architecture or OS, post an Issue.
Binaries
You can find precompiled Binaries for Linux and macOS under Releases.
Docker images are published under Packages.
Docker images
Binary Docker image
This image includes Linux, Rye binary ready for use and Emacs-nox editor.
Docker image: ghcr.io/refaktor/rye
Run it via:
docker run -ti ghcr.io/refaktor/rye
Dev Docker image
The repository comes with a local Docker image that builds rye and allows you to do so.
docker build -t refaktor/rye -f .docker/Dockerfile .
Run 🏃♂️ the rye REPL with:
docker run -ti refaktor/rye
Building Rye from source
Use official documentation or lines below to install Golang 1.19.3 https://go.dev/doc/install (at the time of writing):
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 the main branch from the Rye repository:
git clone https://github.com/refaktor/rye.git && cd rye
Build the tiny version of Rye:
go build -tags "b_tiny"
Run the rye file:
./rye hello.rye
Run the Rye Console
./rye
Install build-esential if you don't already have it, for packages that require cgo (like sqlite):
sudo apt install build-essential
Build Rye with specific modules
Rye has many bindings, that you can determine at build time, so (currently) you get a specific Rye binary for your specific project. This is an example of a build with many bindings.
I've been working on a way to make this more elegant and systematic, but the manual version is:
go build -tags "b_tiny,b_sqlite,b_http,b_sql,b_postgres,b_openai,b_bson,b_crypto,b_smtpd,b_mail,b_postmark,b_bcrypt,b_telegram"
Build WASM version
Rye can also work inside your browser or any other WASM container. I will add examples, html pages and info about it, but to build it:
GOOS=js GOARCH=wasm go build -tags "b_tiny" -o wasm/rye.wasm main_wasm.go
Run the demo server for testing WASM version
bin/rye server_wasm.rye
Then visit http://localhost:8085 or http://localhost:8085/ryeshell/
Tests and function reference
Run the Rye code tests.
cd tests
../bin/rye main.rye test
Build the function reference out of tests:
cd tests
../bin/rye main.rye doc
Editor support
Rye has Syntax highlighting for Emacs and VS Code. For VS Code just search for ryelang in the Extension marketplace. For Emacs it will be published soon on github.
Rebol - Rebol's author Carl Sassenrath invented or combined together 90% of concepts that Rye builds upon.
Factor - Factor from Slava Pestov taught me new fluidity and that variables are no-good, but stack shuffle words are even worse ;)
Red - Another language inspired by Rebol from well known Rebol developer DocKimbel and his colleagues. A concrete endaviour, with it's low level language, compiler, GUI, ...
Oldes' Rebol 3 - Rebol3 fork maintained by Oldes (from Amanita Design), tries to resolve issues without unnecessarily changing the language itself.
Arturo - Another unique language that builds on Rebol's core ideas.
Charm - Not related to Rebol, but an interesting Go based language with some similar runtime ideas and challenges.
Ren-c - Rebol 3 fork maintained by HostileFork, more liberal with changes to the language.
You can post an Issue visit github Discussions or contact me through gmail or twitter.