logoalt Hacker News

nh2yesterday at 3:43 PM2 repliesview on HN

That does not really matter though: Even immediate-mode approach programs should just not be drawing new frames when the program logic says that there are no new inputs that can result in different pixels (e.g. no user inputs, animations, notifications, text content changes, etc.). One does not need to "poll" for input.


Replies

conartist6yesterday at 4:17 PM

But a video game does!

You see why I think their logic that an IDE should work exactly like a video game does is not as strong as it sounds at first.

They claim browser engines just lack the raw speed to build an experience like Zed, but I know of no reason that it should be true.

lstoddtoday at 6:55 AM

> Even immediate-mode approach programs should just not be drawing new frames

They can't not. When the backend asks for a frame you give it a frame, or the result is not defined (a black rectangle instead of window content usually).

Even if you don't redraw anything at all it's still a 2d blit from gpu memory which is two triangles, a texture and sync object. Or you need to tell the window manager what's the window content this frame by any other way which also inevitably crossess process boundaries and thus is a bunch of syscalls. Plus you need to poll for input anyway.

edit: by "poll for input" I mean the literal poll() syscall. Which is ofc the basis of async and all. How else do you get to know there was any input?