[ClojureScript] Re: Idea for a reactive and faster alternative to Datascript

2015-12-08 Thread Vianney Stroebel (vibl)
Ok, I guess this idea is so stupid nobody even bothers saying it is. :-)

Vianney

On Thursday, December 3, 2015 at 3:40:56 PM UTC+1, Vianney Stroebel (vibl) 
wrote:
> I posted an idea for a reactive and faster alternative to Datascript:
> 
> https://github.com/tonsky/datascript/issues/132
> 
> It seems too good to be true on paper so I probably have overlooked things.
> 
> Comments are welcome!
> 
> Vianney

-- 
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.


[ClojureScript] Re: Idea for a reactive and faster alternative to Datascript

2015-12-08 Thread Zubair Quraishi
On Tuesday, December 8, 2015 at 11:13:25 AM UTC+1, Vianney Stroebel (vibl) 
wrote:
> Ok, I guess this idea is so stupid nobody even bothers saying it is. :-)
> 
> Vianney
> 
> On Thursday, December 3, 2015 at 3:40:56 PM UTC+1, Vianney Stroebel (vibl) 
> wrote:
> > I posted an idea for a reactive and faster alternative to Datascript:
> > 
> > https://github.com/tonsky/datascript/issues/132
> > 
> > It seems too good to be true on paper so I probably have overlooked things.
> > 
> > Comments are welcome!
> > 
> > Vianney

A shame that noone replied. I have not used Datomic so can not comment on it

-- 
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.


[ClojureScript] Re: Idea for a reactive and faster alternative to Datascript

2015-12-08 Thread Vianney Stroebel (vibl)
Ah, never mind.

It's understandable that people don't have the time to test every idea out 
there and don't want to express an opinion until they have done so.

I was so sure that my idea had a big flaw I hadn't seen that I thought it would 
be pointed out by an experienced developer.

Vianney


On Tuesday, December 8, 2015 at 2:16:33 PM UTC+1, Zubair Quraishi wrote:
> On Tuesday, December 8, 2015 at 11:13:25 AM UTC+1, Vianney Stroebel (vibl) 
> wrote:
> > Ok, I guess this idea is so stupid nobody even bothers saying it is. :-)
> > 
> > Vianney
> > 
> > On Thursday, December 3, 2015 at 3:40:56 PM UTC+1, Vianney Stroebel (vibl) 
> > wrote:
> > > I posted an idea for a reactive and faster alternative to Datascript:
> > > 
> > > https://github.com/tonsky/datascript/issues/132
> > > 
> > > It seems too good to be true on paper so I probably have overlooked 
> > > things.
> > > 
> > > Comments are welcome!
> > > 
> > > Vianney
> 
> A shame that noone replied. I have not used Datomic so can not comment on it

-- 
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.


[ClojureScript] Re: Idea for a reactive and faster alternative to Datascript

2015-12-09 Thread Alan Moore
Vianney,

I haven't replied for the same reason other haven't... not a lot of time and a 
lack of understanding your proposal. I also don't want to sound like a broken 
record - I've posted to this list previously about this and figured I'd "stand 
down" to spare everyone the repetition.

However, for those who are new to the list and have not heard of Clara before, 
read on. Everyone else can press delete as they see fit.

The one other approach I would suggest you look into is the Clara library. It 
is a rule engine that works efficiently with small changes to large amounts of 
data/rules. You can think of a rule as an efficient means of creating 
materialized views except that they only fire when new data matches (including 
unification) with existing data/rule patterns.

It takes a little getting used to in a similar way that reactive programming 
inverts control as compared to imperative logic. The typical use would be:

1) Insert new data into existing Clara session (stored in app state)
2) Fire rules (only rules matching the new data), possibly changing the session 
state.
3) Store the resulting session value back into your app state.
4) Rinse, repeat.

For example, this might look like:

(reset! app-state (-> @app-state
  (insert (->PurchaseOrder 123 "PO: 123"))
  (insert (->ApprovalRequest 123 false))
  (fire-rules)))

Note: app-state is an atom that holds a Clara session/db. Also, you can use 
Clojure records as is done above or just plain maps, provided you supply Clara 
with a function that can tell one map "type" from another.

The fire-rules function will run any rules that have been "activated" by 
previous data insertions or removals and can have side effects on the rest of 
the system (e.g. update the DOM, redraw React components, etc.)

A rule that matches the above facts might look (something) like this:

(defrule approve-po-request
   [?po <- PurchaseOrder (== ?id id)] ; ?id variable "bound" to value of id
   [?request <- ApprovalRequest (== ?id id)] ; Bound ?id variable used to unify
=>
   (insert! (approve ?request)))

Negation is also possible in a LHS pattern. See the Clara docs for more info.

http://www.clara-rules.org

Clara also has queries (that share the same LHS syntax as rules) so that you 
can get a snapshot of your state/session. This syntax is declarative and 
similar to datalog and/or core.logic syntax.

I'm currently working to integrate Clara with Om Next (among other things) in 
the same way DataScript has been. I don't have anything concrete to give you 
but I'm sure if you squint you can see the possibilities. I had it integrated 
it with other ClojureScript/React libraries but when Om Next came out I changed 
course and started over.

However, if you just need DataScript/Datomic integration and don't need the 
power of a rule based system, going with the existing Om Next integration will 
be the simplest path forward. Rule engines have their own cognitive overhead 
that some find unacceptable or that doesn't match with their coding style. To 
each their own... YMWV.

Good luck!

Alan

On Thursday, December 3, 2015 at 6:40:56 AM UTC-8, Vianney Stroebel (vibl) 
wrote:
> I posted an idea for a reactive and faster alternative to Datascript:
> 
> https://github.com/tonsky/datascript/issues/132
> 
> It seems too good to be true on paper so I probably have overlooked things.
> 
> Comments are welcome!
> 
> Vianney

-- 
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.


Re: [ClojureScript] Re: Idea for a reactive and faster alternative to Datascript

2015-12-08 Thread Colin Yates
I don’t think that logic holds.

Maybe more specific questions would elicit more response? 

I don’t have any ‘dog in the game’ here, and maybe it really is a stupid idea 
(I doubt it! though but haven’t formed an opinion yet!) but the lack of 
responses doesn’t imply that, merely the cost of people’s attention is quite 
expensive.

Fight that discouragement :-).

> On 8 Dec 2015, at 10:13, Vianney Stroebel (vibl)  wrote:
> 
> Ok, I guess this idea is so stupid nobody even bothers saying it is. :-)
> 
> Vianney
> 
> On Thursday, December 3, 2015 at 3:40:56 PM UTC+1, Vianney Stroebel (vibl) 
> wrote:
>> I posted an idea for a reactive and faster alternative to Datascript:
>> 
>> https://github.com/tonsky/datascript/issues/132
>> 
>> It seems too good to be true on paper so I probably have overlooked things.
>> 
>> Comments are welcome!
>> 
>> Vianney
> 
> -- 
> 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.

-- 
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.


Re: [ClojureScript] Re: Idea for a reactive and faster alternative to Datascript

2015-12-08 Thread Fergal Byrne
Vianney, as one of the github commenters said, fork the repo and try it
out. I'd be happy to see Datascript improved. Please don't interpret
silence as any kind of judgement of your idea.

On Tue, Dec 8, 2015 at 1:21 PM, Vianney Stroebel (vibl)  wrote:

> Ah, never mind.
>
> It's understandable that people don't have the time to test every idea out
> there and don't want to express an opinion until they have done so.
>
> I was so sure that my idea had a big flaw I hadn't seen that I thought it
> would be pointed out by an experienced developer.
>
> Vianney
>
>
> On Tuesday, December 8, 2015 at 2:16:33 PM UTC+1, Zubair Quraishi wrote:
> > On Tuesday, December 8, 2015 at 11:13:25 AM UTC+1, Vianney Stroebel
> (vibl) wrote:
> > > Ok, I guess this idea is so stupid nobody even bothers saying it is.
> :-)
> > >
> > > Vianney
> > >
> > > On Thursday, December 3, 2015 at 3:40:56 PM UTC+1, Vianney Stroebel
> (vibl) wrote:
> > > > I posted an idea for a reactive and faster alternative to Datascript:
> > > >
> > > > https://github.com/tonsky/datascript/issues/132
> > > >
> > > > It seems too good to be true on paper so I probably have overlooked
> things.
> > > >
> > > > Comments are welcome!
> > > >
> > > > Vianney
> >
> > A shame that noone replied. I have not used Datomic so can not comment
> on it
>
> --
> 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.
>



-- 

Fergal Byrne, Brenter IT @fergbyrne

http://inbits.com - Better Living through Thoughtful Technology
http://ie.linkedin.com/in/fergbyrne/ - https://github.com/fergalbyrne

Founder of Clortex: HTM in Clojure -
https://github.com/nupic-community/clortex
Co-creator @OccupyStartups Time-Bombed Open License http://occupystartups.me

Author, Real Machine Intelligence with Clortex and NuPIC
Read for free or buy the book at https://leanpub.com/realsmartmachines

e:fergalbyrnedub...@gmail.com t:+353 83 4214179
Join the quest for Machine Intelligence at http://numenta.org
Formerly of Adnet edi...@adnet.ie http://www.adnet.ie

-- 
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.


Re: [ClojureScript] Re: Idea for a reactive and faster alternative to Datascript

2015-12-08 Thread Vianney Stroebel (vibl)
Thanks Colin and Fergal!

My question would be: has anyone tried something similar?

Namely:
- On the one hand, map-based indexes queryable with Datalog and/or Pull 
queries? (I'm currently looking into the Om Next approach of normalizing any 
data structure and making it queryable with Pull queries).

- On the other hand, live queries / auto-updated materialized views with 
Datalog, Pull queries, Specter or Instar? (Using one of the latter two + a 
lense/reactive library like Javelin might do the trick.)

As I wrote in the proposal, I'm not experienced enough in Clojure to hack 
together a proof of concept (with Datalog and Pull queries) yet. I should be in 
a few weeks/months though. Please keep me in the loop if you're considering 
working on it.

Vianney


On Tuesday, December 8, 2015 at 3:03:54 PM UTC+1, Colin Yates wrote:
> I don’t think that logic holds.
> 
> Maybe more specific questions would elicit more response? 
> 
> I don’t have any ‘dog in the game’ here, and maybe it really is a stupid idea 
> (I doubt it! though but haven’t formed an opinion yet!) but the lack of 
> responses doesn’t imply that, merely the cost of people’s attention is quite 
> expensive.
> 
> Fight that discouragement :-).
> 
> > On 8 Dec 2015, at 10:13, Vianney Stroebel (vibl) wrote:
> > 
> > Ok, I guess this idea is so stupid nobody even bothers saying it is. :-)
> > 
> > Vianney
> > 
> > On Thursday, December 3, 2015 at 3:40:56 PM UTC+1, Vianney Stroebel (vibl) 
> > wrote:
> >> I posted an idea for a reactive and faster alternative to Datascript:
> >> 
> >> https://github.com/tonsky/datascript/issues/132
> >> 
> >> It seems too good to be true on paper so I probably have overlooked things.
> >> 
> >> Comments are welcome!
> >> 
> >> Vianney

-- 
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.


Re: [ClojureScript] Re: Idea for a reactive and faster alternative to Datascript

2015-12-08 Thread Daniel Kersten
I am silent simply because I do not understand the datascript internals
enough - not because I don't like your idea. So try not to be discouraged!

On Tue 8 Dec 2015 at 14:22 Vianney Stroebel (vibl) 
wrote:

> Thanks Colin and Fergal!
>
> My question would be: has anyone tried something similar?
>
> Namely:
> - On the one hand, map-based indexes queryable with Datalog and/or Pull
> queries? (I'm currently looking into the Om Next approach of normalizing
> any data structure and making it queryable with Pull queries).
>
> - On the other hand, live queries / auto-updated materialized views with
> Datalog, Pull queries, Specter or Instar? (Using one of the latter two + a
> lense/reactive library like Javelin might do the trick.)
>
> As I wrote in the proposal, I'm not experienced enough in Clojure to hack
> together a proof of concept (with Datalog and Pull queries) yet. I should
> be in a few weeks/months though. Please keep me in the loop if you're
> considering working on it.
>
> Vianney
>
>
> On Tuesday, December 8, 2015 at 3:03:54 PM UTC+1, Colin Yates wrote:
> > I don’t think that logic holds.
> >
> > Maybe more specific questions would elicit more response?
> >
> > I don’t have any ‘dog in the game’ here, and maybe it really is a stupid
> idea (I doubt it! though but haven’t formed an opinion yet!) but the lack
> of responses doesn’t imply that, merely the cost of people’s attention is
> quite expensive.
> >
> > Fight that discouragement :-).
> >
> > > On 8 Dec 2015, at 10:13, Vianney Stroebel (vibl) wrote:
> > >
> > > Ok, I guess this idea is so stupid nobody even bothers saying it is.
> :-)
> > >
> > > Vianney
> > >
> > > On Thursday, December 3, 2015 at 3:40:56 PM UTC+1, Vianney Stroebel
> (vibl) wrote:
> > >> I posted an idea for a reactive and faster alternative to Datascript:
> > >>
> > >> https://github.com/tonsky/datascript/issues/132
> > >>
> > >> It seems too good to be true on paper so I probably have overlooked
> things.
> > >>
> > >> Comments are welcome!
> > >>
> > >> Vianney
>
> --
> 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.
>

-- 
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.