3 ms·
I’m not sure I buy that Excel is a declarative language. Sure it looks different from your traditional imperative language, but still Excel doesn’t have much wi
by two_handfuls 2y ago
I’m not sure I buy that Excel is a declarative language. Sure it looks different from your traditional imperative language, but still Excel doesn’t have much wiggle room to interpret your instructions.
- bazoom42 2y agoThe post talks about “intent” which is pretty vague. A more common definition is that imperative code specify a sequence of steps to execute while declarative code specify the desired end state, and the engine have to figure out how to arrive there. By this definition Excel is declarative because you don’t specify in which order to execute the operations. Excel has to figure out when and in which order to execute the formula, presumably by building a dependency graph.
- LikesPwsh 2y agoYou could make that same argument for any parallelism - your CPU queues some inputs and processes them in an arbitrary order after considering dependencies. There's a long way between hand-writing CPU instructions to make sure it does the same thing between runs, and the other extreme of writing a terraform yaml config and letting the engine decide how to get there. Excel is so far from SQL/YAML that I can't lump them all together as "declarative". "Column from examples" comes to mind as a more declarative Excel feature than formulas in general.
- naasking 2y ago> You could make that same argument for any parallelism - your CPU queues some inputs and processes them in an arbitrary order after considering dependencies. No, the CPU instructions are explicitly sequenced. The fact that the CPU can sometimes execute them out of order doesn't change this basic fact. Excel is absolutely declarative in its core form. Of course the scripting languages that are embedded can change that, but it's 100% declarative if you don't use that part of it. A = B + C in Excel is not a calculation or assignment operation, it's declaring a relation between those variables that Excel preserves how it sees fit.
- QueensGambit 2y agoOP here. Yes, Excel is technically not a declarative language. However, it's widely used by business users, and its formulas are declarative to a large extent. If AI generates code, Excel formulas might be the best bet for business users to understand. I could have picked an example of metadata generated by no-code tools, but it wouldn't really convey the point about leaky abstraction.