5 ms·
One thing that's special about spreadsheets is that they figure out the order of evaluation from dependency relationships: something that is somewhat unusual in
by PaulHoule 4y ago
One thing that's special about spreadsheets is that they figure out the order of evaluation from dependency relationships: something that is somewhat unusual in mainstream software other than make and dependency injection libraries like Spring.
I'd make the case that figuring out the order to do things in is "one more thing to worry about" and also gets in the way of parallelization.
Note the "old A.I." tools in the 1980s such as logic programming languages like Prolog and the production rules engines (expert system shells) used backward and forward chaining strategies to accomplish this but both had some awkwardness when it came to the cases where the order of execution mattered. My guess is that these techniques will shine again in the new age of low/no code.
- deleted 4y ago[deleted]
- analog31 4y agoLabVIEW is this way too. I wonder if dataflow programming is more intuitive to non-programmers, even if it might run up against limitations when extended to larger projects. Both Excel and LV have a reputation of being a way for non programmers to automate complex tasks.
- PaulHoule 4y agoI'm not sure if this is a fundamental problem or just an accident in how these tools have been developed. That is, many dataflow systems have ways you can make systems by drawing boxes (operators) and lines (connections between operators) but don't give you facilities to make a reusable box which is itself comprised of boxes and lines. If somebody really tried to make a tool of that sort which had a modules and other facilities for programming in the large I know we could do better but this may very well drive away the kind of person who is attracted to these tools. (I think of how many "data scientists" react violently to the slightest bit of SE discipline such as separating the results in a Jupyter notebook from the code that generated those results.) It's a shame because all the time data analysts are thinking about "How do I make the monthly sales report for August?" and not about "... for every month" and it is such a universal and predictable problem but the tools don't give people a structured answered. A concept that I've thought about applying to production rules (and maybe other systems) is "rules and schemes" where the code is divided into multiple layers with a relationship similar to HTML and CSS. Logical rules are one thing, what you do with those rules are another thing. People apply this kind of thinking to a small range of concerns in "aspect oriented programming" but with the right kind of compiler support it could be applied to other things like memory allocation. I hear people complain about "colored functions" when doing async programming but when I write for arduino I often write programs where (in my mind) there are a few (say five) colors of function that all play a particular role in the system and I even avoid automatic variables on the stack because they are just a waste in a program of that sort.
- steve1977 4y agoIsn’t it the human users who figure out the dependencies and enter them explicitly?
- DennisP 4y agoHumans enter the dependencies, but not the order of evaluation for those dependencies.
- munk-a 4y agoI think the dependencies they're talking about are something like A1 = C3*C5, C3 = B2+5, B2 = 12, C5 = 13... to determine the value of A1 you'll need to know the values of C3 and C5 which then depend on B2 so simply computing cells in ascending order wouldn't work for the first iteration and saving the dependency between cells would probably let you work a lot more efficiently as data in the sheet changes. Also, I gave a dumb example involving four cells - some spreadsheets involve thousands of active cells with complicated interdependencies, conditional formatting and hidden ranges... these large sheets are usually rather responsive for how much unstructured complexity is in them.
- PaulHoule 4y agoExactly, you could write formulas like that in Python but you would need to spell out the exact execution order, which is "one more thing you have to worry about" that divides professional programmers from everyone else. At an introductory level it doesn't seem like much but there is a certain point in complexity where it becomes a major burden, particularly when it comes to composing complex systems out of multiple parts. That's how frameworks like Guava and Spring banished the Factory, FactoryFactory, FactoryFactoryFactory, FactoryFactoryFactoryFactory, ... pattern in Java by creating a MetaFactory that sees the relationships between all the parts as a whole and resolves all of the things that would seem circular if you didn't carefully tease them apart manually. Things of this type, however, have a remarkable ability of "slipping people's minds" and you still hear people complaining about the Factoryⁿ problem in Java which is so 1998.
- twobitshifter 4y agowww.observablehq.com Does this for javascript. It was actually a learning curve to use but the code ends up much neater.
- JanisErdmanis 4y agoQML is also very much like that. One declares relationships and the interpreter/compiler figures that out automatically. Highly recommend tinkering on it.
- agumonkey 4y agoit's gonna be the next topic in computing IMO dependency graphs are related to concurrency, decoupling, reactive rendering, lazy recomputation, efficiency and ultimately code concision (if you remove order safety, and memory updates from the code, only few lines remains)