architecture

2020-04-20T14:01:28.152300Z

Does anyone know any good resources that discuss the relationship between types/specs, functions, queries and rule engines? I was doing some late night brainstorming and i want to be able to find a correspondense between them as a way to discuss the trade offs. I find that often people, myself included, land in one camp and find it hard to understand when it would be applicable to move to another. I have been doing this in my head for quite a while. Here is a bit of how i'm currently thinking about it: A function is the mapping between the set of inputs and the set of outputs. Fn1 : S1 -> S2 It's usefulness is judged by its ability to communicate properties of the set its mapping over and perform that mapping. A spec/type is also a function from the set of inputs to a set of outputs. Fn2 : S1 -> S2 A spec/types's usefulness is judged by its ability to communicate properties of the set's it's mapping over. To be useful a spec, type must communicate less then the function. A spec/type's usefulness must also be weighed by the duplication in logic that you put upon the system.

adamfeldman 2020-04-21T17:05:33.152900Z

I’m very interested in the same question. I want to model domains in Datascript and clara (rules engine) then generate working and highly malleable systems built out of spec’d functions, etc. Inspired by https://vvvvalvalval.github.io/posts/2018-07-23-datascript-as-a-lingua-franca-for-domain-modeling.html and https://github.com/hodur-org/hodur-engine

adamfeldman 2020-04-21T17:06:20.153300Z

(alternately, I want to explore and discover the best ways to accomplish that — currently that appears to be Datascript and clara)

Piotr Roterski 2020-04-21T22:41:26.153700Z

you guys might want to take a look at this proof-of-concept integration of fulcro + clara rules (code: https://github.com/fulcrologic/fulcro-rad-demo/blob/rules-demo/src/shared/com/example/rules.cljc and some discussion gathered here: https://www.reddit.com/r/fulcro/comments/f3gjvu/fulcro_rad_clara_rules/ )

👍 1
2020-04-22T14:03:09.154600Z

@adam622 I asked about the relationship between hodur and datalog here: https://www.reddit.com/r/Clojure/comments/ab9h8e/declarative_domain_modeling_for_datomic_ioncloud/ The claim was that the Hodur scehma might serve more implementations then just say datomic. I think my approach if i were building this would be to start with datomic datalog (what ever api i was using). Regardless the challanges are going to be very unique to your needs. Regarding building systems out of speced functions, etc. I think the challange arises mostly at the database level. Even given complete control on a greenfield project it's not clear how much synergy you can get between a rules engine and a database. Naga is the closests i know of, https://github.com/threatgrid/naga, But i have a outdated conference talk level understanding of these topics. Everyone i know that has tried to build a unified system around a data model has run into performance issues that they have to iron out. I niavely think incrmental computation would go a long way to fixing a good many of those issues. @pt.roterski That looks promising. I really think the idea of a rules engine as the state mechanism

adamfeldman 2020-04-22T14:29:37.155100Z

Interesting, thanks @drewverlee! I forgot naga existed and it’s super useful for me to look at it right now. re: incremental computation, there’s https://github.com/sixthnormal/clj-3df

adamfeldman 2020-04-22T14:32:01.155400Z

What kind of performance issues have people run into? Is part of the problem that you have to retrieve and process too much state in order to process a query, because you have to first pull and hydrate the system’s data model from the datastore, and then process the user query?