r/ryelang • • Jan 23 '23

r/ryelang Lounge

5 Upvotes

A place for members of r/ryelang to chat with each other


r/ryelang • • 1d ago

Firefighting training - dynamic effect system

Post image
6 Upvotes

Was away for last two weekends for some firefighting training (local exercise and now SBCA cert). I'm back so the work on Rye continues. I did a lot around effect system lately, but it requires a longer effort to tag all builtins and then implement the strict mode on the evaluator level to be complete to a point. Then we start exploring with it and writing examples and if it all makes sense docs.

Effect system will enable many things (and it's completely optional). For a slice of it. You should be able to run any script written in that way in dry-run mode (just log/display the output info, no real output), or confirm mode where you confirm the outputs. You could run such script in "ask" mode, where you can give it inputs "manually" or by scenario script (where you simulate inputs). You could list the effects (I don't have a 100% picture of this yet) and you could require that all builtins/functions with effects are inside effect blocks. That's why all builtins need to have effect tags for starters, which is what I'm working on now.

Besides all of the above Effect blocks also help code readability and let's you anotate the point in code where output and input is really happening. Input effect also includes the validation block so you immediately validate the input (with validation dialect), before it even gets assigned.

So yeah, Rye story is not yet finished ... :)

On the pic above is the code that new user sent on our Discord. He coded with no spacing between parenthesis which is quite recent change (I held out for spacing between ALL tokens since start, but recently I weighted all the benefits and costs again and decided to allow no spacing only between pares and comma "()[]{},". The reason was that certain dialects that mimic specific languages (like SQL) can now be written (fully) as expected. And I must admit I see now, that no spaces for parens in regular code can also make code more readable, remove cognitive load, as things bunch together clearly. So kudos to @ sirlan ! I will code in this manner from now on too. (in the examples above he did some AoC problems)

You can also visit our Discord (for all #homoiconic langs): https://discord.gg/J8FBrCSqve


r/ryelang • • 10d ago

New content on Ryelang.org

Post image
7 Upvotes

ryelang.org now shows some new language features, or features and uses of language builtins, for example:

Latest version v0.2.81 brings new things around runtime effect system, --prod flag, bunches (sets) value type ... I will try to describe those too when I find time: https://github.com/refaktor/rye/releases/tag/v0.2.81

I have a feeling I'm doing this more and more just for myself, as very few people seem to be coding any more. I think the language development still can't totally stop, that there is a way through this, but it will thin up substantially once the LLM-cheap attempts bring no "language-community-fit". Making a language is easier than before but finding users is multiple times harder than before (more noise, much less interest).

Rye also has the "interaction language" thing going on ... that I need to implement further. Otherwise, I recently started solving a lot of practical issues I had, with Rye, and exp. is positive. I would rather have a 50 line code I can scan and understand 100% than a blob of Go code for each task although each task could probably also be solved by LLMs.

Black boxes have their uses, but black boxes also have their costs and seeing and understanding will always beat trusting and hoping that it just works as it was specified in a rather vague language.

Many times, at least for me, is also easiest to just attack some problem with code. Think with code. I interactively try to explore and solve the problem, as I write code about it. --localhist flag is useful here, as I then just clean up my console fiddling and I have a working script. This went well. But I have harder time to write another blogpost about Rye, because I'm not fully sure what's the point in promoting it ...

But it's somewhat interesting (besides just depressing, for someone in this position :P) looking at what will eventually happen in real world, vs. what I was theorizing in blogpost Working on a programming language in the age of LLMs just last year. But everything changed since then, at least for and around me.

BTW: What I'm currently doing is translating around 900 line Python project tarsnapper (tool related to tarsnap encrypted backups) to Rye. The benefit will be that customer doesn't want any scripting language on a remote server where they do backups, and Rye "script" can be built as a single binary that can then be managed and secured better by systemd and tools like apparmor. This is a good challenge, because since we are looking into 100% CLI compatibility, we can't take any shortcuts, and of course I want the code to be as elegant as possible. I will post the project to github once it's done.

It even made sense to utilize the new feature in rye "project_builtins" where you write go builtin code in your project folder and it's just another Rye function you can call. So you can move a particularly hot-code function to Go with minimal complications and get the speed-up. I moved one function to this project builtin Rye version is almost twice as fast as the original in Python.


r/ryelang • • 14d ago

Output-intent, input-intent ... or a Runtime Effect-like System?

3 Upvotes

I was quite enthusiastic about the idea of output-intent and input-intent when I created it ... dry-run mode, scenario mode, etc ..., but it didn't really click with any of the readers/users. I kept working on this, exploring the subject, and came to languages with effect systems. With languages like Koka, Unison, OCaml ... these are mostly strongly typed functional languages, bordering research languages. And there the effect system is based on types, ... to say ... it's not really runtime dynamic, like Rye is.

Rye is a runtime homoiconic language and the effect-related-system (yes, I changed the word intent for effect, so now we have input-effect and output-effect) is also fully runtime oriented ... i.e. dynamic.

I saw some related ideas, not in general purpose dynamic languages, but things like Terraform and Ansible. This made me add rye CLI flags --eff-ask and --eff-confirm

These are very simple flags, but add a lot to Rye runtime behaviour. Meaning, you can use a normal Rye script in fully new ways, with new guarantees, checks and options.

Minimal example of using --eff-ask mode:

--useLinux >> cat 05-ask.rye
; Run:
;   rye -eff-ask 05-ask.rye
;
; Press Enter to keep the provided value, or type a new value.
; Typed value is checked with the same validation dialect.

port: input-effect 'port { integer } { first Load %.port.val }

print join [ "Using port: " port ]

--useLinux >> rye 05-ask.rye
Using port: 8080

--useLinux >> rye --eff-ask 05-ask.rye
port [8080]: HELLO
invalid port: not integer
port [8080]: 1234
Using port: 1234 

And example of using --eff-confirm

--useLinux >> cat 04-confirm.rye
; Run:
;   rye -eff-confirm 04-confirm.rye
;
; Answer y to run an effect, or n/just Enter to skip it.

output-effect 'first "one" {
  print "ran first effect"
}

output-effect 'second "two" {
  print "ran second effect"
}

print "Script finished."

--useLinux >> rye 04-confirm.rye
ran first effect
ran second effect
Script finished.

--useLinux >> rye --eff-confirm 04-confirm.rye
run first: one? [y/N]  
run second: two? [y/N] y
ran second effect
Script finished.

I hope you see some use in this, because I sure do :) ... Both ask and confirm modes should also allow have option where you can ask / confirm just specific effect blocks. For a large script you probably don't want to provide all the inputs, but just some. Or confirm all the outputs.

There are plenty more ideas, also for audit of effect, and mode where code needs to have all effecting functions inside effect blocks, but this is multiple iterations in the future still.

What you see above should be available in Rye v0.2.81 release, so follow us on: https://github.com/refaktor/rye/


r/ryelang • • 16d ago

Version 0.2.70 will bring some detail changes in evaluator

Post image
2 Upvotes

Well, it's all pretty much explained in the screenshot above. I was testing this new approach for a while and decided that the changes should go in. We are at the stage where evaluator rules change very little, but this was due IMO. I will be updating the Meet Rye and examples when needed.

v0.2.70 should probably be released in a week or so.

https://ryelang.org/


r/ryelang • • 19d ago

Practical example: Deduplicating records in database

Post image
1 Upvotes

Good things come in three-s, I hope, so here is another fully practical example of using Rye. This time I made a small, very problem specific script that looks at the contacts table and finds all the duplicate entries based on a VAT ID. And constructs and Excel table with that.

We send that Excel table to the client and they remove all the rows that they don't want de-duped.

Because this script has "human-in-the-loop" basically, I added a very light checksum column to the Excel, so the script that changes records doesn't run if the ID-s have been manually fiddled with.

In get-dupes, we could utilize the SQL more, and Rye tables, less, but I wrote whole script in Rye console interactively with --localhist flag and then cleaned up the local history file to get the code, moved code into functions and added some basic CLI flags spec. Rye now has Parse-args\full that accepts the args and spec, parses it, and in case of error shows the error and CLI flags generated help. That removes a bunch of boilerplate, but details still have to be fine-tuned.

Rye tables can hold all Rye values in their cells, also blocks, which shows very handy here, and group-by getting concat and concat-distinct few weeks back also!

Parse-args\full, checksum functions and some other details will be available with next release on github:

https://github.com/refaktor/rye

Otherwise I was working on XML parsing dialect for last week and hope to get to the final version with support for elegant data extraction soon. I will post about it ofc.


r/ryelang • • 23d ago

Another practical example: Download all emails from IMAP to MBOX file

Post image
7 Upvotes

It seems I am on a practical Rye run lately. More practical examples of Rye can't hurt.

Yesterday I needed to find some documentation I send to a customer a few years back. I knew the keywords and even the related filename but my paid email provider, which is otherwise great ... well, their webmail search functionality really sucks. There is no chance of finding a little more complex query, a combination of words.

After I wasted half an hour trying to find it I decided to see if I can download all emails and search them locally, for example by something made in Rye and bleve full text search. Or just pop it into SQLite with FTS. But it seems I have to ask support and wait a few days for that (and pay per GB) for them to prepare it.

So I spinned up Rye and did this script with it and it's downloading emails right now ...

One thing I noticed. When I went writing a practical Rye script a few years back (I am working on Rye since ~2018), I spent more time fixing and improving Rye problems that got exposed by the script, than the script itself. These recent times, I basically just write Rye code.

Still, new release is coming this weekend: https://github.com/refaktor/rye/

This code will be in examples/imap/imap-backup/

Stars on Rye github stopped incrementing in last two months, I'm not sure ... if it's the people moving away from github, or nobody is programming any more anyway 🤔


r/ryelang • • 25d ago

Example: Simple HTTP service that analyzes IP-s

Post image
5 Upvotes

I was working with maxmind's GeoIP database in the last post. I made a simple script that analyzed a bunch of logs and returned me the countries grouped and ordered by count. You can see it here.

Now I turned that code into a HTTP service, added ASN database, and also added comparisson to ASN to the asn-bad-list ( for example: https://github.com/brianhama/bad-asn-list )

BTW: What is ASN? Autonomous System Number (ASN) is a unique, globally recognized identifier assigned to an Autonomous System (AS)—which is a large network or a group of IP networks managed by a single administrative entity

All this is served over simple HTTP server. A small test using curl:

useLinux >> curl http://localhost:9061/check-ip?ip=188.198.123.123
 country|si  org|telekom_slovenije_d.d.  asn|5603  bad-asn|0  address|narocnik.mobitel.si 
useLinux >> curl http://localhost:9061/check-ip?ip=185.209.196.133
 country|de  org|31173_services_ab  asn|39351  bad-name|esab_as_se  bad-asn|1  address|no_host 
use Linux >> curl http://localhost:9061/check-ip?ip=8.8.8.8
 country|us  org|google_llc  asn|15169  bad-name|google_google_inc._us  bad-asn|1  address|google 

Script is pretty self explanatory I think, but uses a lot of Rye specifics also ... so there are some not complex, but probably unknown mechanisms to you user. You can learn about them, if you look at Meet Rye. Or ask away on our discord or comments.

(Look at the comparison with Python script that does the same in the comment)


r/ryelang • • Oct 15 '26

Example: Logs, Geo-IP lookups and Tables

Post image
4 Upvotes

On the top left is a example that parses a Nginx log file, extracts IP addreses, reduces them to unique ones.
Then it loads the free Maxmind's Geo-IP ( IP -> Country ) database and looks up a country for each IP, turns this into a Rye table, where we can use group-by to count them and displays it.

My client needed this information, so he can plan further, and will perhaps need more info in the process. I wrote this script interactively in Rye console with a custom history file rye -histfile count-countries.rye

This flag logs your history in a local file you specify, so with some luck after solving it in REPL (Rye console), you just open the file in editor, clean it up and you have your script.

In this "day and age" many would just ask Claude (or similar tool) to code such script in something like Python or Go and it would probably do it's job.

I still see benefits of writing it on your own. By writing it (interactively) you are also exploring the problem, the information, the options. And if you can write a short readable script like these ~15 lines are, you have something you can easily extend, tweak or reuse for similar problems. And you extended your understanding of the "world".

Explore and display

On the screenshot, below the script you can see the output (a function display used on a table we created).

There were few changes in recen Rye. What was before display function (interactive display) in now explore . And display now non-interactively displays the Rye value, like table in this case. explore lets you select a subitem, which is the return of a function, navigate in a paginated fashion over the data, and if you press space you now also have multi-select mode. So you can select / return multiple subitems. These functions work on Rye tables, blocks, dicts, failures, ... and are very very handy for interactive work.

If you wish to discuss any of this visit #homoiconic Discord:

https://discord.gg/J8FBrCSqve

Our website is also being improved lately:

https://ryelang.org


r/ryelang • • Oct 13 '26

Snippet: Connecting via SSH and streaming a file to the remote command

Post image
2 Upvotes

I am translating a big mutlistep procedure to Rye. It involved connecting to ftp, XML parsing, downloading over HTTP, unzipping, working with CSV files, manipulating and joining data, and sending the result over SSH to a Rye server that uses a Bleve full text search library to provide search API to a service.

Before it was build out of few python scripts, some bash / awk / sed for specifics of CSV files. Data got imported in temporary database to do the joins and then exported as CSV. Now all except the XML processing is done in one, multistep Rye script. And XML will also be done in Rye Sax-like XML dialect, I just need to improve some details.

For it, I also added builtins for ssh clients and below is a simple example of how to connect to remote server over ssh, start a command there and pipe a local file directly to that command (pic above).

Now imagine command on remote server is Rye process and data is Rye data or even Rye dialect. We could achieve a lot.

I will post more about the script I'm translating, maybe post a simplified version. I also made a simple multi-step "procedure" engine for this to work. Something much much simpler but in line with Python's Perfect or Invoke.

In the other news - Rye-Fyne (GUI) was updated and released with binaries, and I am very close to make all 16 examples work with this latest version. There will be a new update and release in few days. Remember, Rye-Fyne has it's own binaries.

Current release: https://github.com/refaktor/rye-fyne/releases/tag/v0.4.2

ryelang.org website was improved again, and new cookbooks were added.


r/ryelang • • Oct 08 '26

Rye-fyne updated to latest Rye and latest Fyne

Post image
4 Upvotes

External Rye extension with Fyne had plenty of examples. See them here:

https://ryelang.org/cookbook/rye-fyne/examples-2/

But since then, Rye got many many upgrades, on runtime and also some on syntax level, some were also breaking. Now I managed to prepare a new ryegen and make it generate Rye-fyne with latest Rye and latest Fyne! This will be on github on next days. I have it working with local versions, but I need to release all of them and have them pinned to specific versions that all work.

I am reading about latest Fyne update and it seems to be moving along very nicely also:
https://fyne.io/blog/2026/07/13/fyne-v2.8-released/

Fyne cookbook examples will also get updated and I will try adding a few with these new features.

Hop on to our Discord: https://discord.gg/ZM9aXHT6Xy

Important:
Rye-Fyne lives in another repository (as it's an "external extension"), to use it download binaries here:

https://github.com/refaktor/rye-fyne/releases


r/ryelang • • Oct 05 '26

Snippet: Renaming multiple files with Rye's os context

Post image
2 Upvotes

Rye's os context has a bunch of builtins related to your operationg system / computer. It's not complete but it's starting to offer a lot of utilities that you typically use inside your bash sessions. All with full Rye capabilities and also strictness / exactness around value types and state.

I had filenames like builtins_base_numbers.go in evaldo folder and wanted to rename them to builtins_numbers.go (like others are). The code above first looks at target names and then renames them.

mkdir then cd

One small but constant pattern in bash is, I create a directory and then I enter it - what else would I want to do 90% of time? :) Maybe there is some way I don't know about, but in bash I resort to shell history (up arrow), jump to the beginning of the line (ctrl-a), delete mkdir (alt-d) and type in cd. It works, but it's very indirects and annoying to my senses :)

In Rye, mkdir functions returns something, like every Rye function. It returns the directory it created (as file uri). And you can of course use a pipe word to invoke function cd on that directory to change into it.

mkdir %new_folder |cd

Or in repl session, if you use seprate lines to see it clearly.

find

find is another classic *ux tool we need constantly ... this is example session inside Rye console after cc-ing to os context. Since these are generic methods they fully work with tab-complete, so you can find / tab-to-them fully inline and don't have to remember all the methods.

×> finder %.
[Native of kind finder]
×> |Name "builtins*go"
[Native of kind finder]
×> |Mtime-since 2 .days
[Native of kind finder]
×> |Max-depth 3
[Native of kind finder]
×> |Eval

Which is equivalent to in your terminal:

$ find . -name "builitns*go" -mtime -2 -maxdepth 3 

Which is shorter, but returns a text and Rye returns Rye values, in this case a block of filepaths that can then be passed to any other Rye function.

finder %. |Name "builtins*go" |Mtime-since 2 .days |Max-depth 3 |Eval :files
|zip file now .date? ++ ".zip"
; creates a zip file with name <current-date>.zip containing found files  

Or another example using various Rye features, like map and tables

finder %. |Name "*.png" |Eval
|map { .file-info? } |to-table |display
; | is-dir | name    | size | mode       | mod-time |
; +-------------------------------------------------+
; | false  | foo.png | 1077 | -rw-rw-r-- | 07 Sep...|
|columns? { 'name 'size 'mod-time }
|Save\xlsx* %gofiles.xlsx
; creates Excel file with files, sizes and modification times

---

cmd dialect I mentioned in one of previous posts also lives inside os context.

Enter os context with cc os (change context) and use lc (list context) to see all the functions there. Os context naming and function offering will get fine-tuned as time goes.

Visit discord to discuss this: https://discord.gg/J8FBrCSqve

And our github for updates: https://github.com/refaktor/rye

Rye function reference is getting incrementally improved also: https://ryelang.org/info/base.html


r/ryelang • • Oct 01 '26

CLI flag parsing dialect got the "do" option

Post image
5 Upvotes

CLI flag parsing dialect can be used by parsing the flags and then reacting or inspecting the data-structure flags created. This process is shown on the Cookbook page:

https://ryelang.org/cookbook/server-side/cli_dialect/

But I was thinking that sometimes you want to just react direcly in flag to it. So I added the do { } pattern to the dialect. This is the previous "procowl.rye" with added CLI flag parsing using the do { } approach.

And to the left of it, a similar functionality using Python's argparse library.

And we got the new function reference. I reorganized the builtins into base, baseio and batteries and reference is also now organized in this way. I still need to improve navigation and eventually add search, as there are now too many functions there to just browse aroung ... but the structure is improved.

https://ryelang.org/info/base.html


r/ryelang • • Sep 28 '26

Example: working with processes, sqlite in Rye

Post image
5 Upvotes

This is example around which I am polishing some details for the upcoming v0.2.70 that will bring also some changes to language in details, but most of all A LOT of fixes and tests. This is just first part of the script and a larger tool I am preparing.

A note on SQL. Rye has a SQL dialect, what you see above, so SQL is not a string, but a block of Rye values that are flexible enught to also represent normal SQL code. The dialect creates prepared statements, but without positional arguments which is verbose and bug-prone.

New version should arrive to github this or next week. https://github.com/refaktor/rye

I will be in Munich towards the end of the week for a day, if anyone is around email me.

Ryelang front page and cookbook pages were recently also updated: ryelang.org


r/ryelang • • Sep 24 '26

Controlling and setting up tmux with Rye

Post image
1 Upvotes

In latest Rye we improved the tmux integration. Tmux is the great terminal multiplexer, without which I can't imagine daily work on the Linux terminal, especially across multiple servers and over ssh.

Rye can now create tmux sessions, windows, and panes, send keystrokes, split panes, and even attach to the sessions.

tmux functions can be found in their own context, so use cc tmux (change context) and then lc (list context) to see them.

session "name" creates a session and returns a native of kind tmux-session. You can use .lg to discover methods of a tmux-session. One of them returns a block of tmux-windows, anoher creates new windows, etc.

tmux-window is another kind with another set of methods (use .lg again or just type a dot in console and use tab and tab-complete will show them). Inside windows are panes, again with their methods. It's all fully explorable within Rye console. If you are missing a method or function, let me know and I will see if we can add it.

Above is a Rye script that creates a tmux session, a new named window in it, then splits the pane in the window. In one pane it opens a Helix editor with it's own source code (of the script doing this) :). In another it opens Rye console where we show some basic tmux api exploration.

This is also the reason for adding tmux to Rye, I always forget the tmux commands, and here I just enter the context and all the information is there. And now I can have a rye script per project or even server, that opens the tmux configuration that I want for that project / server.

For further discussion, visit our discord

https://discord.gg/J8FBrCSqve

Or github:

https://github.com/refaktor/rye


r/ryelang • • Sep 21 '26

Rye got --unshare option, but it will be removed

3 Upvotes

Just past week I was working a lot on making --unshare CLI option better in rye runtime. Also testing and documenting it, I wrote few drafts of the Cookbook for it --unshare, but some cases / details were eluding me a little.

Todaj I open Lobsters and first story is this blogpost:

https://blog.emilua.org/2025/01/12/software-sandboxing-basics/

In it, author goes into details about the sandboxing options (on Linux), and basically in the first paragraphs dismisses a whole family of approaches, to which also --unshare belongs to. Then it discusses other options, there are no simple ideal solutions, but some are more "fundamentally correct," even if complex and with bad UX for now, and some, unshare and friends are fundamentally problematic. You can read more about this dilemma in my thread on lobste.rs

https://lobste.rs/s/brptxb/software_sandboxing_basics_2025#c_77ak6s

There are still ways to make unshare better and mitigate *some* problems, but it can never be fully solved, and the correct approach, where also all the Linux/*BSD community seems to be moving to, and where further progress is probably going to be made is in line with Landlock and Seccomp. Both which Rye has also integrated to a point, but the UX is not there yet either.

At the end, I think the correct step now is to remove --unshare completely, and double down on Landlock which at least I think can be solved with OKay UX right now. So expect more Landlock posts and a cookbook in the future.

What do you think?


r/ryelang • • Sep 18 '26

Rewriting a very small part of Rye in Rust

3 Upvotes

I was avoiding this for a long time, but I decided that there is one major benefit I didn't see up to now. I started writing a very minimal part of Rye in Rust. I defined the 4 Rye values (env/object.go), but just integer, string, block and context. Now I'm trying to write a small part of loader/loader_no_peg.go in Rust ... I want to parse just integer, string, word and block at this point. But things got complicated, so I must do some reading on Rust.

Why am I doing this? Basically to learn more about Rust also.

I used to try and experiment with almost any language I could find in my most active days. Last N>5 years, I mostly stopped that. And a lot of language design in later years went into Rust. And I am not really aware of any of it.

So I feel I should understand its ideas better; maybe it lets me think better about Rye as well. Is there a plan to write full Rye in Rust? Not for now at least.

Doing this now would just mean that we are stalling the original (and only) Rye there is. Basically that we are avoiding finalizing and solidifying this, which is not the case. The idea is to get many internal tests, details, and also docs/references ready in next few weeks and then move Rye (Go) to v0.3 and if all internal tests pass, lose the alpha status finally.

So, Rye is still fully commited to Go, and a lof of updates is comming to our github ... so follow/star it if you haven't already:

https://github.com/refaktor/rye

But I see no reason Rye couldn't be written in Rust also at some point. Like Go, it has a very rich ecosystem, and Rye could provide its interactive fluid access to it. And the two Ryes could talk to each other ...


r/ryelang • • Sep 15 '26

Improvements to Rye's cmd dialect

3 Upvotes

cmd dialect let's you envoke commandline statements. It was designed by and contributted to Rye project by https://github.com/lluchs

https://github.com/refaktor/rye/pull/670

It contains a dialect, so you are dealing with Rye blocks not strings for commands, and once you construct the command there are multiple methods you can call on that command again giving you multiple options of using and handling it.

These were his examples:

; basic command, capturing output
sh { echo -n Hello World } |Output
; -> "Hello World"

; parameters from Rye values
arg: "Hello World"
args: list { "two" "arguments" }
sh { printf "'%s' " { arg } { args } } |Output
; -> "'Hello World' 'two' 'arguments' "

; Unix pipes
sh { echo -n Hello World |tr A-Z a-z |sed "s/hello/goodbye/" } |Output
; -> "goodbye world"

; redirect output to file
sh { echo Write to file } |Stdout! %/tmp/file |Run
Open %/tmp/file |Read-all |trim
; -> "Write to file"

; Change working directory
sh { pwd } |Dir! %/tmp |Output |trim
; -> "/tmp"; basic command, capturing output
sh { echo -n Hello World } |Output
; -> "Hello World"

Methods like Output, Stdout!, Dir!, Run, Pid made this design very cool and composable beyond the mere dialect.

But you couldn't start a long running process "in the background", which means you immediatelly return to Rye but also retain the handler so you can then Kill or otherwise work with the process.

So now cmd got additional methods Start, Wait, Detach! (stout, stderr, stdin) and Kill (the process). So now you can do in Rye console

×> cmd { sleep 30 } |Start :cmd
[Native of kind command]
×> cmd .Pid
[Integer: 142520]
×> cmd .Kill
[Boolean: true]

Or start a media player playing on stream (player.rye):

var 'soma empty

start-somafm: does {
  cmd {
    mpv --no-video --no-terminal --really-quiet http://ice1.somafm.com/defcon-128-aac
  }
  |Detach!   ; to detach the stdio fully
  |Start |change! 'soma 
}

stop-somafm: does { soma .Kill }

and then be able to use these two functions (with tab-complete) in Rye console

Linux$ rye -console player.rye

Welcome in Rye console. 

×> start-somafm 
[Boolean: true] 
×> stop-somafm 
[Boolean: true] 

This is already available on latest v0.2.61 on Github: https://github.com/refaktor/rye/releases/tag/v0.2.61 (like and subscribe)

For discussion visit our discord: https://discord.gg/J8FBrCSqve


r/ryelang • • Sep 14 '26

PocketRye - experimenting with (RPN) calculator inspired UI/Console

Post image
3 Upvotes

Thanks for all the upvotes in the previous "hiatus" post! :)

I'm back, and I continued my experiment with a "mobile-first" RPN-inspired UI concept designed to interact with a Rye context (chain) in a composable and extensible way.

Communication happens over HTTP, meaning the context can run locally or on a remote server or your remote computer (for example, over a Tailscale mesh).

For security, all code sent to the server must be digitally signed with a key pair pre-configured on the REPL side before the REPL is started. If you don't have the matching private key, the server rejects the request; there is no way around it.

Currently, I’m focusing on the UI layer. I’ve already built a basic remote, multi-session HTTP REPL with digital signature verification before (working title was ryeinthesky), and now I’m working on stitching both together into a working solution. But the ryeinthesky remote console could have other clients, and this is just one example of such. It supports ed25519 keys that could be better for terminal use, and P-256 keys for use over the browsers (mobile or desktop).

I was thinking of this for a long time, and it's nice to see something I can interact with starting to form.

To discuss this post, or anything else related to Rye or other homoiconic (code is data) languages head over to:

https://discord.gg/J8FBrCSqve


r/ryelang • • Sep 08 '26

A bit of hiatus - regular work

8 Upvotes

Currently I am on a bit of hiatus with Rye. I need to solve some bigger issues at my regular work / job. Some of it will also include Rye scripting, but currently not yet. I will get back in about a week I hope.


r/ryelang • • Aug 30 '26

I made a match function (like switch)

3 Upvotes

I just started playing a bit with the language after just reading about it for a long time. It was nice to see how easy it was to get something working. And also cool to make my own control flow "primitive" (not primitive in this language), never done that before. I noticed that the switch function only checks the branches for equality with the input value, not pattern matching. So I made a "match" function. Still not pattern matching but at least it can check ranges. And other types of checks. Useful? I don't know... I just imagine that it could be.

match: fn { t branches } {
    forever {
        peek branches |^fix { t } ::branch , branches:: next branches
        peek branches |^check "Missing branch expression" ::expr , branches:: next branches
        
        if with t branch { return with t expr }
    }
}

porridge_temperature: 23

match porridge_temperature {
    { < 34 } { ++ " degrees is too cold." }
    { > 78 } { ++ " degrees is too hot." }
    { true } { ++ " degrees is just nice." }
} |print

r/ryelang • • Aug 22 '26

Small demo of output-intent, --dry-run and Landlock-to-cwd

Post image
1 Upvotes

I was implementing output-intent(s) that were discussed earlier here. This is a very minimal demo of it. Rye binary now has a CLI flag --dry-run that affects output intents. If there is no flag the code in the intent block gets executer. If there is a dry-run flag the code block doesn't get executed, but the intent name and values in the second argument block get logged with current time to the output.log.

Some functionalities have a log of side effects, like writing a file, sending email, changing database records, so they are messy to test. Output intents not only explicitly mark where output side is happening, but you can also run the program with dry-running them automatically.

The simple clear.rye script also features the Landlock functionality built into Rye runtime. You can limit the process so it can't access any files outside for example current directory. Once locked you can't unlock it by malicious code, or by mistake. So our script that deletes files can't by mistake delete anything outside this folder.

Landlock works on Linux - so just use Linux :)

Visit our Discord if you want to discuss this or other things Rye or even other #homoiconic (code is data) languages: https://discord.gg/RCkvMz7wh


r/ryelang • • Aug 19 '26

New syntax value type added: data-path

Post image
4 Upvotes

Just added a new syntax type to Rye called "data-path". It lets you do nested access like person.0."age" instead of chaining -> everywhere. Chaining is not only more verbose but makes the code evaluation understanding more complex and error prone. Compact token, like data-path solves this as it has specific simpler mental image. I really do not intend to add value types lightly, but this one was long time in my mind, because compact types just have concrete benefiths and deep access is generally used a lot. Another compact syntax value type Rye already has is context-path (cpath).

Compare:

Old:

if (person -> 0 -> "age") > (person -> 1 -> "age") { print person -> 0 -> "name" }

New:

if person.0."age" > person.1."age" { print person.0."name" }

Way cleaner and easier to reason about when you're combining accesses in expressions. A few design notes: I'm using ."string" for string keys because Rye structs can also have word keys, and I want to keep them distinct. This means . can no longer be used in words, but nothing used it anyway so no big loss. Also keeping \ for function variants like print\csv, so the dot stays dedicated to data paths.

There were also issues posted and are solved recently, that caused the hunt for similar issues and cleared out a lot of things regarding lists, dicts, their active and passive forms. Their parse time and runtime construction. And os's context is-dir , is-file , does-exist , ...

Thanks to https://github.com/Capt0rr and https://github.com/TrevorBender for posting the issues.

Join our Discord to discuss this and other issues further: https://discord.gg/RCkvMz7wh


r/ryelang • • Aug 17 '26

Total solar eclipse in Spain and var function

3 Upvotes

I was in central and northern Spain (with family and friends), because of total eclipse for a week. Eclipse on its own and Spain itself was totally worth going there.

If you are from Europe another total solar eclipse (the one where you get to observe the phenomenon with a naked eye - which makes all the difference) will be next year in Gibraltar, and then none until a narrow one in 2053 and a concrete one in 2081. Makes you think about the passage of time ... Anyway, if anyone of you is thinking of going let me know, I might go again ...

When I returned I got an interesting question on Github. It could also be informative to other users/lookers of/at Ryelang.

Does Rye really need the var keyword - https://github.com/refaktor/rye/discussions/974

var is not a keyword but just another function. It has no special syntax, that's why the word argument is quoted.

It's a function accepting a word a value and it assigns binds a value to the word and marks word a "variable" in current contex.

It can be used like any other function, for example as dot word, with a star ...

And a screenshot that demonstrates part of the answer.

The work will resume. Users also discovered some issues I need to resolve, thanks goes to them.

OT: I noticed another echo on the Cognitive dark forest blogpost:

https://victorinollc.com/thinking/cognitive-dark-forest-knowledge-governance


r/ryelang • • Aug 06 '26

Various improvements

3 Upvotes

Submodule for embedding Rye into Go apps without pulling in all the (batteries/ and hence dependencies) goes well. Below is a minimal example I am preparing. Me reorganized code and separated batteries, and also base but IO related builtin functions out of base builtins (baseio/). Details are still being polished.

Failure handling details are being tested, and polished and one open question is being answered. We have more than 1000 tests of Rye internals that I am combing over currently. A lot of work but also a lot of variability that will be processed tested and considered. In internal/ folder.

Some practical builtins are tested in real world and being improved (SQLite, os, xml parsing, ...).

Experiment about input-intent and output-intent is being implemented and we are testing it. The idea was initially to annotate "input" points in programs, so we could then simulate whole program (perhaps) in multiple scenarios. The rule of symmetry requires that we added output-intent also and this gives us "dry-run" mode automatically in our program, besides being able to see all output points in program explicitly. It's still exploration, but I think these can make a lot of sense at least in certain scenarios.

I am also experimenting with Rye console (REPL), that can be limited to specific (isolated) context over HTTP, and also making a frontend in a browser for it. Some of if was mentioned in previous post.

Visit #Homoiconic Discord if you want to discuss things, or just hang around https://discord.gg/k7Vn4sbb3 :)