Live data from Hacker News

IronCalc – Open-Source Spreadsheet Engine

ironcalc.com

61–70 of 238 posts

Re: IronCalc – Open-Source Spreadsheet Engine

#61

Nice work. Clicked around in it, some default features I'm used to are missing, like clicking on a row or column header to select the whole thing, or double click the resizer between two columns to autosize the column to content length.

Thanks, those things are on the roadmap :)

Re: IronCalc – Open-Source Spreadsheet Engine

#62
post #5

Hey! This is my project! Amazed to see this here. I'll try to answer questions people might have

I haven't looked into the source for your project, but am curious if you are integrating any kind of existing engine/backend (Polars is what I am thinking) into it, or if that is even possible.

Not as of now. We first want to be a first class spreadsheet engine that implements 90% of Excel functions and features like array functions, LAMBDA, ...

A goal of IronCalc is to make things like integrating Polars trivial for a developer.

Re: IronCalc – Open-Source Spreadsheet Engine

#63
post #5

Hey! This is my project! Amazed to see this here. I'll try to answer questions people might have

Amazing project. The question I have is why rust? Is the compiled WASM significantly faster than JS?

Yes, the compiled WASM is significantly faster. Easily by an order of magnitude. I might be completely wrong about this but I _think_ if the brilliant folks at Microsoft research in the calc intelligence group would have waited a few years they might have used wasm instead of TypeScript (https://www.microsoft.com/en-us/garage/wall-of-fame/calc-ts-...)

As for Rust, could have been C or Zig. I just needed a language that minimally compiles to wasm.

There is another reason though. IronCalc runs in the bare metal, not only in the web and needs to have bindings to languages like Python, R or Julia. I can't get that today easily with TypeScript.

Re: IronCalc – Open-Source Spreadsheet Engine

#64
post #56

This looks great! Do you use cached calculation chains for performance optimizations? Do you take volatile functions into account? https://learn.microsoft.com/en-us/office/vba/excel/concepts/...

> Do you use cached calculation chains for performance optimizations? Not yet, there is heavy research in that direction. I will write on this soo-ish > Do you take volatile functions into account? Yes, for instance RANDBETWEEN and NOW are implemented. Things like `IF(RANDBTWEEN(1, 500)> 200,A1, A2)` work fine Thnaks

What does that actually mean, "works"? I don't know how that behaves in Google sheets or Excel. Is it evaluated exactly once the first time the formula is entered? Every time you focus the input? Is the dice rerolled when a1 or a2 is modified? What?

Re: IronCalc – Open-Source Spreadsheet Engine

#65

Earlier quoted context omitted.

> Do you use cached calculation chains for performance optimizations? Not yet, there is heavy research in that direction. I will write on this soo-ish > Do you take volatile functions into account? Yes, for instance RANDBETWEEN and NOW are implemented. Things like `IF(RANDBTWEEN(1, 500)> 200,A1, A2)` work fine Thnaks

What does that actually mean, "works"? I don't know how that behaves in Google sheets or Excel. Is it evaluated exactly once the first time the formula is entered? Every time you focus the input? Is the dice rerolled when a1 or a2 is modified? What?

[deleted]

Re: IronCalc – Open-Source Spreadsheet Engine

#66
post #4

Earlier quoted context omitted.

backend does not imply server to me, it implies software that does the calculating engine work and does not concern itself with display refresh.

Surely that's background not backend.

I wouldn't call it background unless maybe it's async or continues to process stuff while you're doing other things.

Re: IronCalc – Open-Source Spreadsheet Engine

#67

Nice work. Clicked around in it, some default features I'm used to are missing, like clicking on a row or column header to select the whole thing, or double click the resizer between two columns to autosize the column to content length.

IIUC, this project is focused on the calculations, not the UI.

Re: IronCalc – Open-Source Spreadsheet Engine

#68

Earlier quoted context omitted.

> Do you use cached calculation chains for performance optimizations? Not yet, there is heavy research in that direction. I will write on this soo-ish > Do you take volatile functions into account? Yes, for instance RANDBETWEEN and NOW are implemented. Things like `IF(RANDBTWEEN(1, 500)> 200,A1, A2)` work fine Thnaks

What does that actually mean, "works"? I don't know how that behaves in Google sheets or Excel. Is it evaluated exactly once the first time the formula is entered? Every time you focus the input? Is the dice rerolled when a1 or a2 is modified? What?

Hi 8n4vidtmkvmk, the algorithms for evaluating spreadsheets are surprisingly tricky mainly because of the dependencies. The dependencies are only know at runtime and in Excel are lazy evaluated. So things like `IF(condition, value1, value2)` would evaluate first the condition if it is true it will evaluate value1 but not value2. So things that in other programming languages are a circular dependency are not so in Excel. The problem of computing the dependencies might be solved by topological sort. The complication of the runtime dependencies is made worse by having dependencies that change every time (or that their outputs do not dependency solely of their inputs) like random functions or date functions. An optimization while evaluating a spreadsheet would be to only compute those cells that depend on cells whose value changed. If you do that you might miss on those volatile functions.

I realize I am most likely babbling too much.

Yes, volatile functions like RANDBETWEEN get evaluated each time a cell changes. They don't get evaluated when you focus on them.

Re: IronCalc – Open-Source Spreadsheet Engine

#69
post #36

Earlier quoted context omitted.

I don't think a recursion should be involved in the parser. Shift-reduce may be an answer but it does not fix the problem either if you try to implement that. I would like to see real code rather than written homework pieces.

Better not use popular toolchains then: https://gcc.gnu.org/wiki/New_C_Parser https://clang.llvm.org/features.html I think this is a quite popular approach for multiple reasons. That being said, tree sitter uses GLR.

There is no recursion involved in parsing. You keep a stack for the tree.

Re: IronCalc – Open-Source Spreadsheet Engine

#70
post #5

Hey! This is my project! Amazed to see this here. I'll try to answer questions people might have

Very cool library. I like the goal of Excel support (it truly is an incredible platform). A couple of questions:

1) Any plans for programmatic manipulation of pivot tables? Looking across the Python ecosystem, outside of xlwings (which essentially requires FFI manipulation of a running instance of Excel), nothing else makes it possible. It does look like some .NET Excel libraries support it.

2) Will there be ability to use the engine as library? Would love to use something like this through Python bindings.

Post reply on HN