I am not very fond of event loops in general, because they imply "many inputs, 
one output" (process all pending events, then update screen).
For Morphic this is fine, because it displays on one screen, refreshing 
at/around its frequency. But there might be other screens, or network-output, 
file-output, which have different refresh frequencies. Then you would want to 
process input events as they trigger rather than storing them in a queue, such 
that whichever output destination sees the most up-to-date state of the program.

Javascript has this cool function, requestAnimationFrame, which sets a one-time 
callback right before the next redraw. In essence it is an output event, 
allowing some form of reactive programming (no loop, only callbacks on input 
and output).
In Pharo we have InputEventFetcher>>registerHandler: which is great for getting 
input callbacks, but nothing for output :/
WorldState>>addDeferredUIMessage: is probably a closest match, yet it is bound 
to Morphic, preventing experiments on UI/video games.

Any alternatives?

Thibault

> Here is some interesting event loop stuff from Tcl.
> 
> http://wiki.tcl.tk/2567
> 
> I wish we had some easy Tk UI building things in Pharo.
> 
> Spec is okay but not intuitive. As it is the only thing that exposes the
> myriad of various Morphs we have and shields us (somewhat) from the
> underlying details, we have to use it, but its explorability is really
> detrimental to the livecoding side of Pharo.
> 
> Phil

Reply via email to