Post #4449508
2026-08-08 21:45 UTC
I think it would be nice to have an OS that is centered around the idea of "everything that could possibly be a cache is a cache". Which I guess is sort of a functional programming idea?
The pixels of your GUI: Cached result of running the immediate-GUI-rendering application code on the application state.
The pixels of an image in the GUI: Cached result of PNG-decoding a PNG image, which is cached from an image on disk or elsewhere.
Text written into a text input field: Writeback-cached.
The position of a scrollbar: Writeback-cached.
Podcast audio: Cached result of running the decoder on an encoded media file which is a cache backed by discardable fast on-disk cache and slow remote internet media.
Stack memory: Discardable when the task is idle and waiting for events at top-of-stack.
This might allow the OS to make better memory management decisions (about when and what to page in/out, and about whether data should be paged out or discarded), allow the OS to manage disk space more automatically, make it more feasible to have lots of background processes (because discarding all their caches makes them cheap), and maybe even make development iterations and updates easier (as long as an update doesn't modify persistent data structures).
Replies (3)
-
@fugueish@wandering.shop 2026-08-08 21:48
@jann@infosec.exchange compiled code: cached compiler output from source on filesystem and/or network
-
@alwayscurious@infosec.exchange 2026-08-08 23:03
@jann@infosec.exchange I think that’s a great idea, though it’s one that can be taken too far. Some things aren’t worth caching.
-
@tasket@infosec.exchange 2026-08-09 05:21
@jann@infosec.exchange Then your OS has to understand PNG renderers and the types of output they make. And also which other renderers use them, etc.