On 4/1/07, skaller <[EMAIL PROTECTED]> wrote:
> On Sun, 2007-04-01 at 09:56 -0400, Chris King wrote:
>
> BTW: have you seen JoCaml?

I've heard of it but never checked it out, it looks interesting
though.  I'll try playing around with it in the next week or so.

> Perhaps I misunderstand what
> 'reactive programming' actually is?

I think "reactive programming" in general has a slightly different
connotation than "functional reactive programming"... FRP (as used by
the Yale and Brown folks) denotes the system in which programs are
constructed in a functional way, but (1) can reference values which
change over time and (2) can change their own behavior over time
(allowing the system to exhibit state).  (1) is accomplished by having
some sort of toplevel controller which monitors external stimuli and
reevaluates the functional expressions whenever the stimuli changes.
The toplevel could be a thread that reads from a channel or it could
be triggered by a callback; it doesn't matter much since it is hidden
from the programmer.  (2) is accomplished by having the toplevel
maintain the state of the entire system, allowing the programmer to
rely solely on functional forms such as transition functions.

Basically the whole question of callbacks vs. blocking threads vs. CPS
is avoided with FRP... you don't have the awkward "push" model
associated with callbacks but you get to keep the reactivity you
"lose" with blocking threads (which are more suited to question/answer
models than interactive GUIs), and you get CPS "for free" (since to
FRP, CPS amounts to just changing your behavior for the next time
cycle).

Of course, it's possible to control-invert FRP for things such as
dialog boxes if you have either threads or continuations at your
disposal.  You need only two new functions: one to block until an
event occurs, and one which emits an event when some blocking function
returns.

> Do you mean fthreads? Pthreads are just that: pre-emptive threads,
> typically Posix threads.

Oh!  Yes I did; braino on my part.

> >  I've
> > played around with it a little in Felix... flxcc did a beautiful job
> > of wrapping the library :)
>
> It did? Lol .. hmm.. hard to tell if that's sarcasm or what .. :)

Haha no, no sarcasm... after I figured out what it wanted in the
config file it did a decent job wrapping everything.  Though certainly
if I was doing it by hand I'd do it totally differently and make use
of Felix's overloading (XCB has a lot of similar functions that differ
only in their type).  Of course anyone from XCB would tell you to
extend the XCB code generator instead, but I'd rather write a 20-line
flxcc config file than XSLT stuff any day :)

- Chris

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to