On Tuesday, April 21, 2015 at 5:28:40 AM UTC-7, Julien Eluard wrote:
> I am also curious about the advantages of using something like Clara versus 
> DataScript listen feature. Especially there has been discussions [1] of 
> improving listen so that it can accept a query details argument.
> Alan I can see you commented on this ticket how do you think it compares to 
> Clara?
> 
> Cheers,
> Julien
> 
> [1] https://github.com/tonsky/datascript/pull/12

The two are very close in concept but I think, under some conditions, Clara has 
an advantage in being based on the Rete algorithm. My guess is that the Rete 
algorithm might be more efficient but am unsure where the cost/benefit cross 
over is re: # rules, amount of data, etc.. It heavily depends on how much 
commonality/overlap and sharing happens in the graph which is dependent on your 
rules and their structure. Caveat emptor.

Rete doesn't have to recompute the results of the query over and over again as 
data arrive like I suspect Datascript would have to. With Datascript, after 
each query is run there is no memory of what the previous results were. Rete 
maintains the state of all of your rules/queries across all of your data that 
you insert/remove in/out it.

Re: Datascript and listen! At a conference a couple years ago I asked Rich a 
similar question re: Datomic, I couldn't hear his response very well but I 
think he said that Datomic doesn't support persistent queries and probably 
won't. I would think that datalog could handle it but I don't know how you'd do 
it. I think that pull request says the same thing basically if I'm reading it 
right.

I know this kind of thing is very powerfule - I embedded Jess into IE 4 as a 
Windows Scripting Engine way back in the day. Just like javascript, Jess code 
could be embedded in your page using <script language="jess">(defrule xyz ...) 
</script> and you had full access to the DOM and events, with all the event 
wiring/registration happening automagically, etc. It made for a really elegant 
programming model.

It worked great but internally it was a tangled mess of C++ COM objects, 
jscript, and java. IE 5 broke everything so I gave up on it.

As previously mentioned, I'll post a more complete example of Clara tomorrow 
after I recover from my trip.

Take care.

-- 
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 clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to