[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MirageOS-devel] Blog post on Irmin/CueKeeper



Le lundi, 22 juin 2015 Ã 12:11, Thomas Leonard a Ãcrit :
> I'd be particularly interested to hear about suggestions for avoiding
> the React GC issues.

I didn't look this into details but you should be able to use strong stop for 
that. See e.g.  

http://erratique.ch/software/react/doc/React#strongstop
https://github.com/dbuenzli/react/blob/master/test/js_hisig_test.ml

Other than that interfacing the results of an update step with side-effects is 
always a little bit tricky and uncharted territory. Ideally libraries should 
allow you not have to deal with update steps at all and provide you a direct 
and clean FRP model. E.g. that's what useri [1] tries to do, I have also 
started other experiments for the dom which tries to correctly hides strong 
stops so that the end-user doesn't have to bother. I'd like to eventually maybe 
distribute as a separate library see [2] but it's really not finished yet as I 
first had to try to define a pleasant API to work with the dom in the first 
place (though that seems like an oxymoron).  

In any case it's in general a good idea to minimize side-effectful 
events/signals to output your dependency graph as you have no control over the 
order of these updates. With respect to this I think that this comment:

"I think that to complete its goal of having well-defined semantics, React 
needs to stop relying on weak references."

is somehow misguided. Even if weak references are no longer used you will still 
get into problems with side effectful events/signals as you will never have any 
control on the order their update since by the very semantics of React all of 
these effects are supposed to happen simultaneously (synchrony hypothesis) but 
won't in practice. In general my advice has always been to try to put queues or 
conflict solving data structure at the output of the dependency graph and have 
effectful events/signals simply add information to these structures and then, 
once the update is over go over this information to actually perform the 
consistent and correct effect that corresponds to the instantaneous update step.

Best,

Daniel

[1] http://erratique.ch/software/useri/doc/Useri.html
[2]  
https://github.com/dbuenzli/remat/blob/master/src-www/brr.mli
https://github.com/dbuenzli/remat/blob/master/src-www/brr.ml
https://github.com/dbuenzli/remat/blob/master/src-www/br.mli



_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.