Toots for carlozancanaro@aus.social account

Written by Carlo Zancanaro on 2024-11-30 at 10:55

I've just spent the evening fighting Bundler and the way it represents git dependencies, but I finally have my #ruby project building using #guix, with a manifest that's imported from a Gemfile, similar to Bundix[1].

It's pretty hacky, but now that I've figured out enough to get our (fairly complex) project working I'm more confident that I can get this working more generally.

If I manage to clean up my patch allowing channels to add commands to Guix then I might even get to have a "guix ruby" command to convert a Gemfile (and/or Gemfile.lock) into a Guix manifest.

=> More informations about this toot | View the thread

Written by Carlo Zancanaro on 2024-11-19 at 06:42

I've written a #ruby library for database-backed production rules: https://sr.ht/~czan/active_record_rules

At $dayjob our main project is a #ruby on #rails project. We have a lot of callbacks on our ActiveRecord models with some complex logic behind them, which has generally been pretty painful. We tend to have three problems:

  1. we trigger expensive recalculations too often, because our callbacks are too broad;

  1. we don't trigger recalculations when we should, leaving things in an inconsistent state; and

  1. we trigger recalculations synchronously and delay our response to the user.

I've always been interested in using production rules as a tool for programmers to express business logic, in the vein of Clara Rules (https://www.clara-rules.org/). I've never been able to find one that works on top of a relational database, though, despite finding literature on the concept from the early 1990s.

ActiveRecordRules is my attempt to write a system to do this. I read about RETE/TREAT, and other algorithms for production systems, but in the end I just rely on Postgres to be smart. 🙂

My question is: does anyone know of other libraries that solve a similar problem? I'm interested in anything resembling a production rules system, no matter what language it's written in.

=> More informations about this toot | View the thread

=> This profile without reblog | Go to carlozancanaro@aus.social account

Proxy Information
Original URL
gemini://mastogem.picasoft.net/profile/109290639843332733/reblog
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
252.609543 milliseconds
Gemini-to-HTML Time
0.624031 milliseconds

This content has been proxied by September (3851b).