> The only real difference is while true: awaitEvent(ev); process(ev); draw() > and while true: if > peekEvent(ev): process(ev); draw().
@Araq, Ah, if that is what you mean by supporting both. Then yes, you can support both. In general, event-driven programming can easily be supported in an immediate procedural environment or context. Basically, mimicing an event-driven-only environment such as JS in a web browser. As long as it is well understood the opposite doesn't work. Reminds of a project I once worked on: translating the original text-adventure game, Colossal Cave, to javascript to run in a web page. Philosophically, it can't be done in any "translation" sense. I mean, you **can** rewrite it completely from scratch to do the same thing with the same data. But then it is not an immediate mode program any more. But there is no way to code a batch program to run in a web browser outside using of a highly convoluted peek-at-progress-so-far emulation layer. There are frameworks that do this in other languages, though I never found one for JS.