News for hackers. Stuff that matters.
Re:Array Languages vs. the Curse of the Spreadsheet by kevingadd on Tuesday March 05, 2024 @04:57PM (#39609632)
Definitely has me wondering: there are lots of regex compilers out there, so where are the spreadsheet compilers? I should be able to convert a spreadsheet wholesale to Java or c# that clearly expresses the cell relationships, then go in and add names (if they aren't already there)
Re:Array Languages vs. the Curse of the Spreadsheet by KMag on Tuesday March 05, 2024 @05:45PM (#39610093)
20 years ago, I was told there was such a beast for turning an Excel spreadsheet into a C# application, targeted at accelerating/productionizing financial models. I never used it, though.
Re:Array Languages vs. the Curse of the Spreadsheet by _dain_ on Tuesday March 05, 2024 @06:30PM (#39610435)
I know of some Python libraries that do this:

  https://github.com/bradbase/xlcalculator
  https://github.com/dgorissen/pycel
  https://github.com/vinci1it2000/formulas
You give it an .xlsx file and it compiles to a Python representation where you can mutate "cells" and observe calculated results in other "cells", according to the formula DAG. Not sure about other languages but I'd be surprised if Python were the only one to have libraries like this.

Funfact: it's more complicated than you think to implement these engines. There's no spec for the formulae, so you have to reverse-engineer based on observed behaviour. You run into a lot of strange edge cases in seemingly mundane arithmetic formulae, and type conversions are a constant source of surprise.