On Sun, 2007-04-01 at 09:56 -0400, Chris King wrote:

BTW: have you seen JoCaml?

> topological sort (this is how PLT Scheme's FrTime works IIRC).
> Unfortunately this means the stack still isn't empty until the entire
> graph is traversed (you've still got a while loop and a priority
> queue) but there's probably a way around this too.

The only way is to control invert by stack swapping.
Pthreads do that. Felix also does it for procedural code
by swapping pointers to heap chains representing the stack.

CPS (continuation passing) does it explicitly .. probably the 
most interesting technique. Perhaps I misunderstand what 
'reactive programming' actually is?

Anyhow the Felix model is similar to CSP (communicating sequential),
that is, control is active, not reactive  (although of course
you can do callbacks too).

> gtk_main_iteration_do() [1] looks promising... it checks if there's
> any events pending, and if so, dispatches (one of?) them.  It comes in
> blocking and non-blocking varieties.

Yes, but that is the problem .. it dispatches an event, triggering
a callback.

Generally this isn't a problem, in that you can just use the callback
to requeue another event.

But in GUI's this can't be done because the callbacks are required
to have certain behaviour .. eg a Paint routine actually has to
paint stuff etc, or the GUI won't work.

With both Windows an raw X11 there is a queue, and the user
writes the loop that fetches from the queue and dispatches
the event. In particular .. there's no requirement to write
a loop as such, any routine can read the queue and decide
what to do. In particular Felix could do it.


> Speaking of X11... have you checked out XCB [2]?  

No, but I am now .. thanks for the link!

> It's X.org's
> replacement for Xlib.  One of its features is "latency hiding", which,
> instead of enforcing the request/response/request/response order of
> Xlib, allows you to send out multiple requests without blocking and
> receive their responses in arbitrary order.  It seems like a good fit
> for Felix's pthreads (with each XCB "cookie" corresponding to an
> ichannel), but the devil may be in the details, I'm not sure. 

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

However Felix has an asynchronous I/O system which handles
asynchronous notifications and blends them into the
fthread (fibre, cooperative multi-tasking) system.
The basic design by r.fistman .. it's rather nice.

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

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net

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