Fork me on GitHub
#hoplon
<
2017-08-19
>
tbrooke13:08:54

I was once fascinated with Clips - a expert system tool based on the Rete Algorithm that has appeared in Clojure as Clara https://github.com/cerner/clara-rules and now I am seeing it being used for UI: https://github.com/CoNarrative/precept and https://github.com/arachne-framework/factui this may be somewhat tied to react but I thought it would interesting to explore in Hoplon — by someone smarter than me of course

dm313:08:44

you could use something like Factui with Hoplon by wrapping the queries into cells. Have one input cell with the fact db. defrule then become analogous to a formula cells.

thedavidmeister14:08:00

yes i'm quite interested in precept

thedavidmeister14:08:12

i've been using datascript in cells so far

thedavidmeister14:08:40

but i understand precept could be much more efficient than that right?

dm314:08:47

yeah, the rete engine trades off memory for speed - it will choose the rules to evaluate efficiently based on the facts that changed

dm314:08:20

you can’t do that in general datalog

thedavidmeister16:08:18

i think that could be very beneficial based on my experience so far

thedavidmeister16:08:43

datascript in a UI tends to lend itself to many small changes because of the datoms structure

thedavidmeister16:08:06

and then you're re-running all these queries, maybe even queries for other routes if they're cached in a tpl

thedavidmeister16:08:59

but i don't think that it actually takes up that much memory out of the box, it's just churning through queries that don't change

thedavidmeister16:08:08

so the tradeoff might be quite smart

thedavidmeister16:08:42

you'd need many datoms to use up even 100mb of RAM i think

dm317:08:48

sure, for a single client, unless it’s some sort of a physical simulation, the amount of data shouldn’t be that high

dm317:08:00

so it definitely makes sense on the client

thedavidmeister17:08:02

yeah i'm thinking "typical" web dev

dm317:08:32

and you still can use the cell abstraction to build up reusable elements

thedavidmeister17:08:15

yeah that's what i haven't done yet

thedavidmeister17:08:24

figured out how to hook precept into cells

thedavidmeister17:08:45

i imagine it would almost be a 1:1 drop-in replacement at that point

thedavidmeister17:08:49

ymmv but so far i've found datascript to be a performance bottleneck much more often than hoplon

thedavidmeister17:08:06

and the workarounds usually involve dropping down into raw datoms manipulation

thedavidmeister17:08:31

so from that perspective precept/javelin integration is an exciting future project 🙂

flyboarder18:08:34

⚠️`[hoplon/brew "0.3.0"] deployed to clojars!` ⚠️ This repo has been stable for a while.