| Incremental lambda calculus is a fascinating concept, I hadn't heard of it before. A theory of changes for higher-order languages: incrementalizing λ-calculi by static differentiation - https://dl.acm.org/doi/10.1145/2594291.2594304 From the abstract, I get the impression it would require very granular atomic-level language transformations, that are only practical for languages that are designed from the ground up to support creating and applying such deltas. Rust and JavaScript/React seem overly complex for reducing down to that level of granularity, especially the latter for strictly typed and deterministic changes. Maybe a language like Haskell is more suitable, since I've heard that it (or a subset) can be compiled down to typed combinators as primitives. > probably need a language with HKT Ah, that sounds related to the thought above, that the technique may be best implemented at the level of language design. Does "HKT" mean "higher kinded types"? Closest I could find was a library for TypeScript: https://majorlift.github.io/hkt-toolbelt/ > _truly_ immediate mode framework where each widget is a pure function It sounds like the "functional reactive" paradigm, which I think React is loosely based on and probably UI libraries like Imgui and others in Rust also. But none of them are "pure" like you describe because the languages they're built on are not pure all the way to the bottom. (Maybe Rust is, but it's likely too complex to practically "diff" and "patch" not only the data models but the running code incrementally, though I may be misunderstanding.) |
I'm not referring to FRP, just a bunch of functions that can render a frame of UI if you pass in all the "internal state" like cursor position/selection/scroll in addition to the typical UI parameters. Xilem and others are doing a good job of making a lot of things modular, but I haven't seen one actually separate how the UI state is stored from the rendering of the UI.