3 ms·
It seems to not be a true spreadsheet with dependency tracking and instead it recomputes everything after each change. Whis probably kind-of obvious as how to t
by dfox 2y ago
It seems to not be a true spreadsheet with dependency tracking and instead it recomputes everything after each change. Whis probably kind-of obvious as how to track the dependencies for arbitrary Python code is not that obvious. But without resorting to some static analysis magic one could just track accesses to the magic S[] during the excecution of the cell, its value cannot depend on anything else than what was accessed during the evaluation.
- cmcconomy 2y agowhat if you wrap all your cell contents with a memoize
- mewpmewp2 2y agoOr maybe worst case allow user to add deps like in React useEffect.
- dgacmu 2y agoThat gets broken by constructs like sum(all of column 5) when new rows or columns are added. (It's very similar to the problem of locking in databases)
- movpasd 2y agoOne issue with this is that arbitrary Python code can have arbitrary side-effects. Your suggestion reminds me a lot of fine-grained reactivity like in SolidJS, which makes sense, since spreadsheets basically operate on reactive programming. Some great articles by Ryan Carnatio on the topic. The side-effects thing comes in if a user puts in some side-effect in a dependent cell, which is equivalent to adding side-effects in a memo in reactive-speak.