caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Satoshi Ogasawara <ogasawara@itpl.co.jp>
To: daniel.buenzli@erratique.ch
Subject: Re: [Caml-list] [ANN] PEC ver. 1.1
Date: Wed, 18 Apr 2012 10:59:16 +0900	[thread overview]
Message-ID: <4F8E1FF4.5070702@itpl.co.jp> (raw)
In-Reply-To: <F7294E8F02FB474AA2373765B8BCAB57@erratique.ch>

Hello,

(2012/04/18 4:23), Daniel Bünzli wrote:
>> - PEC's update cycle is separated from sending events.
>> You can send a value to event during update cycle.
> What's the semantics if you send two different values to an event during an update cycle ?

They fires two different event if you send two different value to an event
even if same update cycle. Events send are stored in an event queue,
and they will be poped by 'run' function just like GUI event loop.

>> - PEC doesn't hold any pointer(including weak one) to event until the
>> event will be subscribed.
> I'm not sure how that's different from react. If an event has no dependents (by which I understand your "subscribed"), react doesn't hold any pointer either.

React constructs 'heap' to hold dependency graph inside the library.
let e' = map (fun x -> x + 1) e, the e' and e are weakly pointed by the heap.
PEC doesn't have heap structure in the library. This is a difference.

This difference is important if you want to translate the OCaml event
combinator to javascript because javascript doesn't have weak pointer.

>> - All PEC's signal are switchable. 'switch' means you can replace dependency
>> of a signal keeping signals depends on the signal unchanged.
> How is that different from react's E.switch/S.switch ?

Almost same except all signals are created though react's S.switch at initializing.

It's convenient to design library for dynamic event driven systems. For example,
let me assume a signal of window size property.

type window = {
    size : (int * int) signal;
}

If you want to change the dependency of window.size after initialize the window
keeping signals depends on the size unchanged, there is no way except making switch
event at initializing.

type window = {
    size : (int * int) signal;
    size_switch_event : (int * int) event event;
}

I feel it's not convenient. So I decided to embedded the swith_event to inside of signals.

Regards,
   Ogasawara

  reply	other threads:[~2012-04-18  1: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 [this message]
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
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=4F8E1FF4.5070702@itpl.co.jp \
    --to=ogasawara@itpl.co.jp \
    --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).