Live data from Hacker News

Ask HN: Language compiled to Excel spreadsheets?

news.ycombinator.com

1–10 of 50 posts

Ask HN: Language compiled to Excel spreadsheets?

#1
Hi!

Yesterday there was a thread about biggest problems with Excel. I’d like to ask you for an opinion on an idea - source code for Excel. The goal is to give people who create models and tools in Excel the advantages of having a source code to what they are building and maintaining. It is challenging and time-consuming to build spreadsheets that are really solid, minimize the chance of errors, that can be unit-tested and version controlled.

The idea is to create a declarative language which lets you describe fields, tables and worksheets in spreadsheet. You are encouraged to use names instead of cell coordinates. For formulas you just use Excel’s formula language. There’s a simple “compiler” that converts that into a spreadsheet.

Compared to regular Excel: - you can unit-test the source code - you can keep it in version control - it’s much easier to read and reason about (it’s auditable) - the outcome is a spreadsheet that satisfies the best practices (e.g. formula cells are blocked, input cells are validated).

What do you think about the idea? Who could make a good early adopter?

Re: Ask HN: Language compiled to Excel spreadsheets?

#3

Hmm, there may be merit in this. Though a counter case was when my brother just wrote a C# plugin for my dad to perform some of the more annoying functions he was dealing with.

Would it be beneficial if your dad was able to achieve the same on his own by using the language?

Re: Ask HN: Language compiled to Excel spreadsheets?

#4
post #3

Hmm, there may be merit in this. Though a counter case was when my brother just wrote a C# plugin for my dad to perform some of the more annoying functions he was dealing with.

Would it be beneficial if your dad was able to achieve the same on his own by using the language?

Really hard to say I think, anything is possible.

Re: Ask HN: Language compiled to Excel spreadsheets?

#5
I think that the advantage of Excel for non programmers is that it's less abstract and you can see all the intermediate results instead of having a mental model in your head. Also it makes some bugs show faster, because you see the immediate result.

Perhaps an alternative is to make something between Excel and "text" programming. Usually a big spreadsheet has many almost independent blocks. Make some mini-spreadsheets with names and clear title rows/columns. Allow the mini-spreadsheets to be positioned easily and connected by formulas.

(Disclaimer: I use a lot of Excel instead of small scripts, the main problem is that you cant's nest 3 for loops.)

[In a related way, I saw some physicist program small calculations in Mathematica because it's more interactive than Fortran and it's easier to make graphs and find the errors.]

[There are some similar attempts. For example in Racket you can use #lang frtime to get a "reactive" program thatauto updates the values. http://docs.racket-lang.org/frtime/ It's a pity that the docs don't have an easy example.]

Re: Ask HN: Language compiled to Excel spreadsheets?

#6
This is a useful idea, IMO. I would use it for programmatically generating complex reports in Excel. Would be nice if it supported advanced stuff like charts and PivotTables too.

I've recently been messing with some Office files (mostly XLSX) using various libraries in Node, and I've been thinking that a transpiler type of tool would be great for this use case, given that an XLSX file is basically just a zip file with some XML files.

Re: Ask HN: Language compiled to Excel spreadsheets?

#8
We did something like this in OfficeWriter [1]. We built a set of APIs to create, edit and generate Excel (and Word) files programmatically without the need for MS Office in the server. In addition, we had a "template mode" so a user could place datamarkers within an existing Excel spreadsheet. At run-time, our code would open the spreadsheet, populate data from a provider data source and then expand all associated cell references such as formulas, charts, etc.

so it was not fully declarative but would not have been difficult to map a high level language to our API. Some sophisticated customers did something to that effect with a web based wizard type interface.

Microsoft purchased the IP in 2007. The independent product is still sold and maintained for existing customers.

[1] www.officewriter.com

Re: Ask HN: Language compiled to Excel spreadsheets?

#10
I did something like this when I was doing lots of data analysis for a research project: [1]

The problem space I was addressing was more restricted than a fully generic spreadsheet model, but I found everything you say about reproducibility and descriptiveness to be true. I kept my report/plot descriptions in git alongside the experiment setups / parameters.

FWIW, prior to this, I often wrote one-off Python scripts that would generate, e.g., 1000 rows of a particular set of formulae in CSV then import that into Excel. It probably wouldn't be hard to build a little tool in a few hundred lines of code to do this.

[1] https://github.com/cfallin/scomp

Post reply on HN