caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Satoshi Ogasawara <ogasawara@itpl.co.jp>
To: "Daniel Bünzli" <daniel.buenzli@erratique.ch>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] [ANN] PEC ver. 1.1
Date: Thu, 19 Apr 2012 17:59:23 +0900	[thread overview]
Message-ID: <4F8FD3EB.5050307@itpl.co.jp> (raw)
In-Reply-To: <B6E07E1F07A048D1BE101C5F5D01C781@erratique.ch>


(2012/04/19 7:32), Daniel Bünzli wrote:
> Yes because the semantics of [e] is violated, it has three values at the same time, the current value during the update cycle, the value 1 and the value 2. Now suppose I reason about the semantics of [e] in this program, it has a well-defined outcome *for [e] itself* if I send it a value [v]. However if you now add a new module that uses [e] and does :

Thank you for helping me understand with your explanation.

If I understand correctly sending [v] to [e] immediately during update cycle
are violate the semantics because it cause more than one values on one event at
the same time.

Using React,

let e, sender = E.create () in
let e' = E.map (fun x -> Queue.add q (fun () -> sender 1); x + 1) e in
let e'' = E.map (fun x -> Queue.add q (fun () -> sender 2); x + 1) e in

does this code violate the semantics of events? If so, PEC is also unsound.
I'd like to know PEC is unsound or not.

 > So if I understand correctly you are doing manual memory management via (un)subscribe 
of the leaves of the dependency tree and instead of having weak "forward" pointers from 
events to their dependents you have regular "backward" pointers from events to the events 
they depend on. Once these leaves are subscribed we can follow them backwards to find out 
what their primitive event set is and understand what needs to be updated along the way.

Yes, exactly.

 >It may be an interesting approach to avoid weak pointers but I'd need more thinking to 
convince me it can correctly handles all the dark sides of leaks, fixed point definitions, 
signal initialization and dynamically changing dependency graph. By the way you still need 
to update the events in the correct order/and or only once to prevent glitches, how do you 
achieve that ?

To prevent glitches, PEC distinct one update cycle to another by time identity.
And calculated results are cached for same update cycle.
Update order is straight forward. Just follow from leaf to primitive source event.
It's not problem because only one primitive value changes at one update cycle.

Best Regards,
   Ogasawara

  reply	other threads:[~2012-04-19  8:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-17 16:40 Satoshi Ogasawara
2012-04-17 17:52 ` Adrien
2012-04-17 18:50   ` Satoshi Ogasawara
2012-04-17 19:23 ` Daniel Bünzli
2012-04-18  1:59   ` Satoshi Ogasawara
2012-04-18  7:36     ` Daniel Bünzli
2012-04-18 11:44       ` Satoshi Ogasawara
2012-04-18 13:27         ` Daniel Bünzli
2012-04-18 17:39           ` Satoshi Ogasawara
2012-04-18 22:32             ` Daniel Bünzli
2012-04-19  8:59               ` Satoshi Ogasawara [this message]
2012-04-19 10:31                 ` Daniel Bünzli
2012-04-19 10:57                   ` Daniel Bünzli
2012-04-19 13:31                     ` Satoshi Ogasawara
2012-04-19 13:02                   ` Satoshi Ogasawara
2012-04-19 14:09                     ` Daniel Bünzli
2012-04-20  9:24                       ` Satoshi Ogasawara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F8FD3EB.5050307@itpl.co.jp \
    --to=ogasawara@itpl.co.jp \
    --cc=caml-list@inria.fr \
    --cc=daniel.buenzli@erratique.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).