Preskoči na glavno vsebino

Objave

Prikaz objav, dodanih na januar, 2023

Interactively displaying Rye values in Console

Still in the theme of blurring the line between programming languages and user interfaces , I improved the display function. It interactively displays Rye values. Enter returns the selected value as you would return it with code, escape returns Void. Blocks, Dicts, Spreadsheets and SpreadsheetRows now work with display . Next I need to make it work with contexts, then adding an option to recursively enter and exit sub-values (I am not sure how I would make that visually yet), add search, select ... This is also a stepping stone towards more interesting and not yet fully developed ideas, so I hope I will work on this more soon. It this sounds interesting you can follow further development on Github or our absolutely new Reddit group !  

Function docstrings, sub-contexts, language as an UI

In the last blog-post I showed a simple utility script that de-duplicates some information. I made a quick interactive solution by using just Rye console to interact with the functionality. I still keep to the idea of language as an user interface , which this simple example was sort of.  For it to be a little better user interface, the ls function mentioned upon entering the console should only display relevant functions, not all Rye's builtin functions. This can be achieved easily with contexts. Normally, when a file evaluates, it's context is the same as the root context of the language. But I now added a --subc flag to Rye executable, which runs code in a sub-context of the root context. So ls just shows what was defined in current code. It also makes sense for ls to show more than just word names, but also descriptions of functions. I added a "docstring" option to Rye function syntax. Both can be seen below. We could very simply create a context for the con

Simple example of de-duplicating contacts (SQLite)

I must first excuse myself. I haven't been working on Rye for a while. It's not that I forgot about it, far from it, but my regular projects took over for a while. I needed to make major updates at the end of the year at some project, and also re-started a SaaS project for compact support teams that I created in Rebol more than 10 years ago, used ever since, but haven't found time to finalize and offer to others yet. I was also struck a little by ChatGPT demos, and took some time to familiarize myself with GPT, BERT and similar techologies. This was all Python based, so I had no chance to inject it with Rye. This period is unfortunately not over yet, but last week I needed to make a simple script on one of the servers, to de-duplicate some data. Users entered the same contacts multiple times and assigned tasks to them. Script needed to find the duplicates (triplicates, etc.), assign all tasks from the older one to the newer one, and remove the older contact. For the simp