News for hackers. Stuff that matters.
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.

There are no comments on this comment yet.