Skip to main content

Ralsina.Me — Roberto Alsina's website

Sheety 1.1.0: This time it's personal

This is the sec­ond re­lease of Sheety my tool to com­pile spread­sheets to na­tive code.

Yes, that means that you can take a spread­sheet and turn it in­to a bi­na­ry, which run­s, where all your for­mu­las are com­piled to na­tive code. This is a very weird pro­jec­t, but it's al­so lots of fun.

What is new in this re­lease?

Bugs Fixed

  • Cells with names like A100 were not be­ing rec­og­nized as valid cell names. Now they are.
  • The cache was not be­ing in­val­i­dat­ed when the sheety bi­na­ry changed. Now it is.
  • Up­dat­ed for more mod­ern crys­tal ver­sion­s.

Performance

This was the fun part.

Extract similar formulas to a function

If you had two for­mu­las like:

=IF(A1>0, A1*2, A1/2)
=IF(A2>0, A2*2, A2/2)

Ver­sion 1.0 would gen­er­ate two sep­a­rate func­tions for each of those for­mu­las, which is waste­ful. Now it gen­er­ates a sin­gle func­tion, and calls it with the cell as an ar­gu­men­t. This makes the gen­er­at­ed code MUCH small­er.

Don't generate code for each cell's task

Previously, each cell would generate code to create a separate Croupier::Task, and now we have a table that is looped, and we only have one instantiation. Again, makes the code simpler.

Split the generated code into multiple files

This was a bit sur­pris­ing. I have an ex­am­ple that has 9900 cells with chained for­mu­las. Ver­sion 1.0 gen­er­at­ed a sin­gle file with 9900 func­tion­s, and the com­pil­er would crash be­cause it ran out of mem­o­ry.

Split­ting it in mul­ti­ple files and not en­abling op­ti­miza­tions makes the com­pil­er hap­py and stay be­low a cou­ple of GB or so. This is an is­sue with the crys­tal com­pil­er it­self, and this work­around makes that large file ac­tu­al­ly work.

Conclusion

As usu­al: this is use­less for 99.99% of peo­ple, but it's a fun code­base, and I am con­fi­dent it would make for a nice work­shop or talk. If you want to try it, just check http­s://sheety.ralsi­na.me and down­load the bi­na­ry for your plat­for­m. It works on Lin­ux.

You can prob­a­bly build it from source on Win­dows and Mac, but I haven't tried it. If you do, please let me know how it goes.


Contents © 2000-2026 Roberto Alsina