while (running) {
event := get_next_event()
process_event(event)
repaint()
}
You could just have get_next_event block until there is a meaningful event that occurs (e.g. mouse click). You could even have your UI report "interactive" rectangles to the event layer to prevent it from producing e.g. mouse move events that are irrelevant.
That being said, I find the error handling via multiple return values + or_return pretty nifty, and the vendored libraries give it a very “batteries-included” feel.
For example, you can render hardware accelerated graphics and de/serialize JSON without downloading any packages.