On Mon, Apr 20, 2015 at 1:45 PM, Kurt Sys <[email protected]> wrote:

> The basic stuff I need is really very similar. What I like about react, is
> not the dom diffing as such, the 'should-update' mixin. This really can
> make things way easier. It doesn't play as nice as I thought it to be
> between rum and datascript queries, but it'll work. Datascript queries are
> really amazingly powerful to me. I use them really a lot, and full dom
> diffing might be pretty, or more, expensive compared to a 'should-update'.
>
> That said, I had been looking to clara before (for another kind of
> project), but I pretty much like the idea of using it as 'database/query
> engine'-someting. Would you implement something like the should-update on
> component basis as well. I'm really very interested in your wrapper/library
> and how it would work out.
>

The nice thing about Clara (and rule engines in general) is that you can
declare that certain functions (RHS) are to be called when a set of
conditions/queries (LHS) over your data evaluate truthfully. There is no
need for "should-update" polling, it is more don't call us, we will call
you - control is inverted. When a user or server event happens the handler
code inserts the event data into the engine and then calls the fire-rules
function to trigger subsequent actions based on the rule conditions.

Clara does truth maintenance which is an awesome feature but in my use case
I have to work around it slightly to accommodate transient facts/events.
Not a big deal just something to keep in mind when first understanding how
it works.

I don't really see there being a need for a wrapper around Clara - you can
use it as-is. I'm just trying to figure out the best way to integrate it in
the client-side context. It was built with a particular set of use cases in
mind that don't always match up with my experience with other rule engines
that are more "mutation" oriented. Clara's rule engine is a value in the
same way that Datomic's database is a value. This is super powerful but
that means you need to organize your code slightly to take this into
account.

Alan

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to