If you find the right category you can write code that looks just like we are calculating everything each time declaratively. But under the hood its done incrementally. Just need to find the right category for it. This can be messy in typescript, but quite clean in Haskell.
I've been experimenting in typescript. And something I found is that sodium is actually already does incremental lambda calculus well, but it only does it for atomic types (without having to write a lot of code). It feels like we are so close, but just have to push a little further. (By atomic types I mean the value fully changes
float rather than partly changes
Without sodium here is the category I propose.
data IncF a b = IncF (a -> (b, IncF2 a b))
data IncF2 a b = IncF2 (Δa -> (Δb, IncF2 a b))
With sodium here is the category I propose.
data IncF a b = IncF (Cell a, Stream Δa) -> (Cell b, Stream Δb)
If all primitive functions are written in the given category, then using those in just FP style gives you incremental computation for free... well almost... Lots of primitives to rewrite.