What’s Rye? Dynamic programming language focused on fluid expressions, still in development.
What’s it for? Interactive use, back-end jobs, servers, information exploration and processing.
Rye console demos:
Spreadsheets ·
Exploring JSON ·
Testing vectors ·
TODO in a REPL ·
Per project builds
Rye is a high level, homoiconic dynamic programming language based on ideas from Rebol, flavored by Factor, Linux shell and Go. It's still in development, but we are focused on making it useful as soon as possible.
It's written in Go and could also be seen as Go's scripting companion as Go's libraries are very easy to integrate, and Rye can be embedded into Go programs as a scripting or a config language.
I believe that as a language becomes higher level it starts bridging the gap towards user interfaces. Rye has great emphasis on interactive use (Rye console) where we intend to also explore that.
Short Rye examples
"Hello World" .replace "World" "Mars" |print
; prints "Hello Mars"
"12 8 12 16 8 6" .load .unique .sum
; returns 42
switch 'cow { dog { "woof" } cow { "mooo" } cat { "meow" } }
; returns mooo
regexp "([0-9][a-z])" |submatch? "-7--x3--0k-r--"
; returns 0k
{ "Anne" "Joan" "Adam" } |filter { .first = "A" }
|for { .print }
IO, Spreadsheet, HTTP client
read\lines %data.txt |with
{ .length? .print , .tail 5 |print }
load\csv %ryebots.csv |where-equal 'level 7
|column? 'score |avg
get https://ryelang.org |write* %page.html
|reader |parse-html { <a> [ .attr? 'href |print ] }
HTTP, SMTP server
http-server ":8082"
|handle "/" new-static-handler %public_html
|serve
http-server ":8081"
|handle "/time" fn { w r } { .write to-string now }
|serve
handler: fn { mail from to origin } {
printv from "new mail from {}" }
smtp-server ":25" |serve ?handler "demo"
Dialects
dict { name: "anakin" } |validate {
name: required calc { .capitalize }
score: optional 0 integer }
; returns { name: "Anakin" score: 0 }
; Rye like Rebol or Lisp has no operator precedence.
; But it has Math dialect which has it and more.
math { 2 + 2 * sqrt ( 12 + ( 24 / 3 ) ) }
; returns 42
rye .args .first :id
open sqlite://data.db
|query { select * from operator where id = ?id }
GUI
do\in fyne {
lab: label "I'm Waiting ..."
btn: button "Click here" does { lab .set-text "Finally ..." }
box: v-box [ lab layout-spacer btn ]
with app .window "Button" {
.resize size 200.0 100.0 ,
.set-content box ,
.show-and-run
}
}
If examples above made you interested, you can delve deeper into the Rye language and Rye runtime. You have two sources for that, both are still work-in-progress, so check back later for more and better content:
Meet Rye | Focuses on Rye language, it's basics, concepts and components |
Rye Cookbook | Focuses on practical uses and specific technologies |
Rye can run on Linux, Mac OS or Windows. Rye also runs in a web-browser (Wasm) and Docker. Rye could be compiled for mobile (Android and OSx).
You can try a (work in progress) Rye console right now by clicking a button on top-right of this page.
x86 64 | arm 64 | arm v6 | wasm | |
---|---|---|---|---|
Linux | v0.0.23 | v0.0.23 | v0.0.23 | |
Mac OS | v0.0.23 | v0.0.23 | - | |
Windows | v0.0.23 | v0.0.23 | - | |
/ | v0.0.23 |
Homebrew | brew install ryelang |
Docker | docker pull ghcr.io/refaktor/rye:latest |
Rye's Github repository is where everything happens. You are welcome to visit it, read it, star it, post issues, contribute ...
Since Rye uses Go, building it from source is very simple. Follow instructions in the README.
Rye's main binary comes with core language functions and also a lot of bindings and technologies already included. At least in a very basic level. Below are some examples of already included technologies:
AWS Bcrypt BSON Crypto FT search Goroutines HTML parser HTTP servers JSON MySQL Psql Postmark Regexp SMTP server SXML SQLite
Rye can be extended internally or externally. Two bigger external extension are developed in their own repositories:
Fyne GUI framework | Rye-fyne repository |
Ebitengine game engine | Rye-ebitengine repository |
Ryegen | Ryegen repository |
Github Blog Reddit Old blog Asciinema Youtube
Rye tries to explore some maybe absurd dualities:
• First version of Rye-Gio posted on Github Gioui is a Golang immediate mode UI library [2024-10-07]
• Added Cookbook > Rye binary showing commands and flags that make Rye binary much more versatile [2024-10-03]
• Binaries for GUI library Rye-Fyne available on Releases page [2024-10-01]
Thank you for visiting this site and reading to the end. If you see any potential here, don't be a stranger, join, star or subscribe us on github, reddit, youtube, ... or just send me an email!
Especially github is usually updated every few days! If you want to contribute in any way, even better, there are always open tasks to complete, from docs, tests, examples, to Go coding.