What’s Rye? A programming language focused on fluid expressions, still in development.
What’s it for? Interactive use, backend, servers, information exploration and processing.
Interactive demos:
Spreadsheets demo ·
Exploring JSON ·
Testing vector functions
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
new-server ":8082"
|handle "/" new-static-handler %public_html
|serve
new-server ":8081"
|handle "/time" fn { w r } { .write to-string now }
|serve
handler: fn { mail from to origin } {
printv from "new mail from {}" }
new-smtpd ":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 }
To learn how Rye works and can be used check (work in progress) Meet Rye. Our unit tests also produce a function reference with examples you can check.
Rye can currently run on your Linux or Mac OS desktop. Rye also runs in your web-browser (Wasm) and Docker. Rye could be compiled for mobile (Android and OSx) and Windows.
Focus is on command-line / backend use, but we are experimenting with a multiplatform GUI Fyne in Rye-front project.
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 | |
---|---|---|---|
Linux | v0.0.16 | v0.0.16 | v0.0.16 |
Mac OS | v0.0.16 | v0.0.16 | - |
Wasm: v0.0.16
Docker: docker pull ghcr.io/refaktor/rye:latest
Rye's Github repository is where everything happens. Please visit it, read it, star it, post issues, contribute ...
Since Rye uses Go, building it from source is very simple. Instructions are on the README.
Rye integration with frontent (GUI) toolkit Fyne happens in Rye-front repository.
Github Blog Reddit Old blog Asciinema Youtube
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, to Go coding.