4 ms·
Thank you for your reply. I'm thinking the code for your average CRUD or even desktop compositor. A compositor copies pixels from multiple places into one plac
by samsquire 4y ago
Thank you for your reply.
I'm thinking the code for your average CRUD or even desktop compositor. A compositor copies pixels from multiple places into one place. Surely that can be defined with a simple loop? But no there's hundreds of APIs in the way. Add Wayland and X11 and you have something that is opaque and understood by very few people.
The motivation behind my comment was that most of programming computers is gluing together APIs to shift data from one place to another before doing something useful with it. The APIs themselves do very little addition or subtraction of data but actual just moving data around and placing it into the right place.
Maybe defining where things should be, declaratively, in order to do a calculation would be useful. So the shape of the calculation defines the data structure, rather than the data structure defining the caclulation.
- csdvrx 4y agoFor a compositor, I'd think of the set pixels being changed (an "invalidation") a good example: the constraint would be to update it on the screen. Unchanged? Don't bother, leave it as-is. I think that's how Intel power saving works. Now think about the MVC model: some changes in the data could result in a change in the view if the data currently shown on screen is what has changed - like triggers in SQL. I wonder if you could have everything work like that?
- samsquire 4y agoYou're right, and thank you for bringing async up. And thankyou for bringing up constraint propagation. One of my ideas is the definition of formulas that act as materialized views over other materialised views. So we can layer materialized views over other materialized views and then work out a derived formula that is potentially nearer to what we want and potentially summarise the formula without needing to calculate the underlying views, we can compute the formula directly. Is this differential dataflow? I think it's an application of algebra and JIT compilers could do it to expressions if we fed symbolic expressions of programming languages into sympy or machine algebra. In react, react does diffing between virtual DOM nodes to see if there are changed. There is also dirty region checking in old games and damage regions. These problems are mathematically defined. Here's my writings on the idea https://github.com/samsquire/ideas4#31-algebraic-materialised-view-edits-and-whole-program-optimisation https://github.com/samsquire/ideas4#31-algebraic-materialise...
- csdvrx 4y ago> I think it's an application of algebra and JIT compilers could do it to expressions if we fed symbolic expressions of programming languages into sympy or machine algebra Yes and the constraints could be the used to reduce the computational costs, giving higher performance and lower latency. A while back, a good friend (we even shared HN accounts for a while lol) pointed me to pipelinedb: a PostgreSQL timeseries plugin for continuously updating """materialized views""" I use a lot of quotes around, because it wasn't either like a regular view (computed when you query it, which introduces latency) or a materialized view (frozen, needs to be refreshed, same problem) but more like the NO_HZ tickless kernel: the update of the calculations was caused by the introduction of new data, not the passage of time (which would be wasteful) The general approach makes a lot of sense to me, and I see how it could be used for more generic problems.