Hacker News new | ask | show | jobs
by oersted 12 days ago
This kind of immediate-mode rendering is quite standard for TUIs. Although immediate-mode rendering tends to be significantly simpler and use less memory than retained-mode rendering, at the cost of some redundant computation. So I am not sure if this is the reason for the bloat.

It’s possible that it doesn’t play well with JS garbage collection, since it recreates the whole UI structure for every frame (which tends to not to be an issue in the languages immediate-mode is usually employed).

But yes it’s a bit more akin to game renderings than web rendering. Which can be totally fine if done well.

1 comments

I haven't tried to make a TUI admittedly, but double buffering is the oldest technique on the planet. A TUI doesn't even need to pay the cost of a lot of pixels since its effective resolution is much lower
Long long time ago, I used to do some graphics stuff in 320x240, which uses a whopping 64KB per buffer, and still has more resolution than a terminal.

In 1GB I could probably fit all the buffers to double-buffer all the TUIs in a whole country. Well, maybe not. But it's likely not that far off.