News for hackers. Stuff that matters.
Re:IronCalc – Open-Source Spreadsheet Engine by nhatcher on Saturday November 09, 2024 @02:22PM (#42096304)
Hey! This is my project! Amazed to see this here. I'll try to answer questions people might have
Re:IronCalc – Open-Source Spreadsheet Engine by ericra on Saturday November 09, 2024 @04:00PM (#42096867)
Great project. I particularly love the:

1) mit license 2) using plausible instead of Google analytics. Practically speaking, uBO is going to block both by default, but for non-tech users this is great. 3) appreciate how the app respects your pc when the web app is running in the background. Very low footprint, no random CPU spikes or anything.

Wish you guys the best.

Re:IronCalc – Open-Source Spreadsheet Engine by nhatcher on Saturday November 09, 2024 @04:22PM (#42096979)
Thanks :).

WRT: Plausible. I think I will remove all kinds of analytics, I'm not yet convinced I should be using them at all. That being said I had been longing to try Plausible for the a long time and this seemed like a good opportunity.

Re:IronCalc – Open-Source Spreadsheet Engine by nhatcher on Saturday November 09, 2024 @04:50PM (#42097124)
If you are curious, I just made the analytics public:

https://plausible.io/ironcalc.com

I think more than one folk in HN might be interested. All traffic is because of this post. I had no visitors as of today. This was work in progress :)

Re:IronCalc – Open-Source Spreadsheet Engine by twojacobtwo on Saturday November 09, 2024 @06:44PM (#42097617)
Sweet, it's basically data on HN users then.

Only 13.4% of HN readers use Firefox. For shame. But seriously, it's interesting that safari is top by quite a margin.

Re:IronCalc – Open-Source Spreadsheet Engine by lbotos on Saturday November 09, 2024 @08:14PM (#42097948)
I assume that's mostly iphones?
Re:IronCalc – Open-Source Spreadsheet Engine by rsi_triad on Saturday November 09, 2024 @07:07PM (#42097705)
* HN users who don’t block analytics
Re:IronCalc – Open-Source Spreadsheet Engine by mgkimsal on Saturday November 09, 2024 @09:17PM (#42098193)
I have to imagine most of that safari is mobile safari / iPhone traffic?
Re:IronCalc – Open-Source Spreadsheet Engine by ksec on Sunday November 10, 2024 @01:42AM (#42098836)
It will be HN user who dont block the analytics. That is with no DNS or uBlock solution.

I would imagine both solution being much more popular on Desktop / Laptop. Hence 75% of all views counted are actually from Smartphones.

Re:IronCalc – Open-Source Spreadsheet Engine by fragmede on Sunday November 10, 2024 @02:09AM (#42098891)
What do your logs say for breakdown on user agent?
Re:IronCalc – Open-Source Spreadsheet Engine by echoangle on Saturday November 09, 2024 @03:31PM (#42096699)
Where does the name come from?
Re:IronCalc – Open-Source Spreadsheet Engine by nhatcher on Saturday November 09, 2024 @03:38PM (#42096752)
The first well known spreadsheet application was called VisiCalc[0] (the killer app!). The "Iron" side is because it is written in Rust and the domain was available.

[0]: https://en.wikipedia.org/wiki/VisiCalc

Re:IronCalc – Open-Source Spreadsheet Engine by fatih-erikli-cg on Saturday November 09, 2024 @02:35PM (#42096386)
Where and how do you handle the operator precedence? I couldn't find in the codebase.
Re:IronCalc – Open-Source Spreadsheet Engine by nhatcher on Saturday November 09, 2024 @02:58PM (#42096514)
I wrote about it at length here:

https://www.nhatcher.com/post/a-rustic-invitation-to-parsing...

The implementation in IronCalc follows that.

Re:IronCalc – Open-Source Spreadsheet Engine by mdaniel on Saturday November 09, 2024 @02:56PM (#42096498)
I'm cognizant it's just documentation, because the code is its own thing, but it seems to be a recursive descent parser https://github.com/ironcalc/IronCalc/blob/2c2228c2c26386b019...
Re:IronCalc – Open-Source Spreadsheet Engine by fatih-erikli-cg on Saturday November 09, 2024 @03:10PM (#42096585)
I see nothing that makes asterisks evaluated prior to ohers. If it's an "eval" in js or wasm whatsoever I would recommend hn mods to mark the post a spam.
Re:IronCalc – Open-Source Spreadsheet Engine by bonzini on Saturday November 09, 2024 @03:31PM (#42096688)
The function for asterisks and slashes is called from the functions for pluses and minuses. The result is that asterisks and slashes are evaluated before pluses and minuses. It's actually very easy to understand once you get the idea.

https://en.wikipedia.org/wiki/Recursive_descent_parser

Re:IronCalc – Open-Source Spreadsheet Engine by fatih-erikli-cg on Saturday November 09, 2024 @03:39PM (#42096761)
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.
Re:IronCalc – Open-Source Spreadsheet Engine by bonzini on Saturday November 09, 2024 @04:16PM (#42096944)
You're conflating parsing of expressions with operator precedence parsers (aka Pratt parsers). IronCalc uses a recursive descent parser, and Pratt parsers are an optimization of recursive descent parsers. Pratt parsers have one function that implements all precedence levels, while recursive descent parsers have one function per precedence level, but they contain basically the same logic.

Source: 20 years ago I converted GCC's C++ parser from recursive descent to an operator precedence parser; obviously GCC respected precedence even before my work, which was purely an optimization. In fact the code I replaced had the note "The expression parser recurses through the various levels of precedence as specified in the grammar, rather than using an operator-precedence technique".

https://github.com/gcc-mirror/gcc/commit/b8b94c5ba81744d325f...

Re:IronCalc – Open-Source Spreadsheet Engine by fatih-erikli-cg on Saturday November 09, 2024 @04:36PM (#42097033)
Operator precedence is an addition to parsing of expressions. Both of them is needed if you accept "2 + 1" kind of expression. "2 + 2 * 2" must be evaluated like "2 + (2 * 2)". Only expression parsing will evaluate them like 8.
Re:IronCalc – Open-Source Spreadsheet Engine by bonzini on Sunday November 10, 2024 @12:51AM (#42098707)
You can choose: learn recursive descent parsing, or keep on being confidently incorrect.
Re:IronCalc – Open-Source Spreadsheet Engine by amluto on Saturday November 09, 2024 @04:28PM (#42097001)
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.

Re:IronCalc – Open-Source Spreadsheet Engine by fatih-erikli-cg on Saturday November 09, 2024 @06:36PM (#42097587)
There is no recursion involved in parsing. You keep a stack for the tree.
Re:IronCalc – Open-Source Spreadsheet Engine by bonzini on Sunday November 10, 2024 @12:51AM (#42098711)
Recursive descent uses the processor stack as the parsing stack.
Re:IronCalc – Open-Source Spreadsheet Engine by fatih-erikli-cg on Sunday November 10, 2024 @12:21PM (#42101320)
Recursion is mostly involved in interpreter, and most of the time it is a bad practice. No recursion needed in parser.
Re:IronCalc – Open-Source Spreadsheet Engine by bonzini on Sunday November 10, 2024 @01:38PM (#42101735)
Dunning-Krueger effect at its best, I am done arguing.
Re:IronCalc – Open-Source Spreadsheet Engine by readthenotes1 on Saturday November 09, 2024 @03:21PM (#42096639)
What keeps me in Excel 2007 is Goal Seek.

I'm not sure how unusual I am, but would be interested in knowing:)

Re:IronCalc – Open-Source Spreadsheet Engine by nhatcher on Saturday November 09, 2024 @03:42PM (#42096779)
Thanks for the feedback, I will keep this on the back of my head. This and things like sensitivity analysis are not in our immediate roadmap, but this is the kind of thing that would be fairly easy to add. You can do it right now programmatically, of course.
Re:IronCalc – Open-Source Spreadsheet Engine by wslh on Saturday November 09, 2024 @02:38PM (#42096403)
Thanks for your great work! I’d love to hear your thoughts on a recent “brainstorm” a few of us had here on HN about spreadsheets. How does this resonate with you? [1][2]

[1] https://news.ycombinator.com/item?id=42027356

[2] https://news.ycombinator.com/item?id=41970554

Re:IronCalc – Open-Source Spreadsheet Engine by nhatcher on Saturday November 09, 2024 @03:30PM (#42096687)
Hi wsih, thanks! There is a lot to unpack on those threads but of the top of my head: 1. Clear separation between UX/backend Done by design in IronCalc. It is first a spreadsheet engine.

2. Multi language support, language connectivity, enhanced data types, ...

You might very well be right, but out first step is to be as close to Excel as possible. We are ~ 1 year away from being formula compatible in a reasonable way. Once we are there we can do better in different directions. I think strict typing might be very beneficial for spreadsheets engines. Anything you can do to reduce errors and human mistakes.

I strongly believe that having a competitive spreadsheet engine fully open source might be a good first step in extending and improving Excel.

Let's see!

Re:IronCalc – Open-Source Spreadsheet Engine by wslh on Saturday November 09, 2024 @05:03PM (#42097183)
I am sure you are in the right track! It would also be great to know if you have some kind of business model on mind.
Re:IronCalc – Open-Source Spreadsheet Engine by nhatcher on Saturday November 09, 2024 @05:24PM (#42097295)
Noup. I'm not doing this for money. Not saying there is not a business angle, and happy to help anyone that wants to build a business using IronCalc.
Re:IronCalc – Open-Source Spreadsheet Engine by enugu on Sunday November 10, 2024 @01:07AM (#42098759)
Hyperfiddle and Quadratic implement some of the items on your wishlist (richer data types, modern programming languages, working with arrays, better connectivity to data tools).
Re:IronCalc – Open-Source Spreadsheet Engine by nhatcher on Sunday November 10, 2024 @05:51AM (#42099536)
They are both amazing tools!
Re:IronCalc – Open-Source Spreadsheet Engine by airstrike on Saturday November 09, 2024 @04:40PM (#42097058)
Where were you when I started writing my code ;_; I have also written a spreadsheet engine in Rust from scratch, for an app built with the iced GUI library!

I'll take a deep dive through your repo and compare notes later this week. Congrats on the huge lift!!

Re:IronCalc – Open-Source Spreadsheet Engine by nhatcher on Saturday November 09, 2024 @05:37PM (#42097344)
Thanks you very much! Lets continue talking on Discord in the coming days!
Re:IronCalc – Open-Source Spreadsheet Engine by phonon on Sunday November 10, 2024 @03:07AM (#42099038)
Re:IronCalc – Open-Source Spreadsheet Engine by nhatcher on Sunday November 10, 2024 @05:45AM (#42099516)
Oh wow! Good find!
Re:IronCalc – Open-Source Spreadsheet Engine by airstrike on Sunday November 10, 2024 @05:49AM (#42099527)
Hah! It wasn't open sourced then, but I did buy the book and followed his advice!
Re:IronCalc – Open-Source Spreadsheet Engine by dpe82 on Saturday November 09, 2024 @04:42PM (#42097072)
What a cool project! I intend to dive in and I'm sure I'll have questions as I do. Are you active in Discord? The invite link on the bottom of ironcalc.com isn't currently valid.
Re:IronCalc – Open-Source Spreadsheet Engine by nhatcher on Saturday November 09, 2024 @05:06PM (#42097197)
Ooops, just fixed it. Here is the link:

https://discord.gg/zZYWfh3RHJ

I don't necessarily respond every day immediately, but I am active.

Re:IronCalc – Open-Source Spreadsheet Engine by airstrike on Saturday November 09, 2024 @04:53PM (#42097140)
I got in via https://discord.gg/zZYWfh3RHJ from the github repo
Re:IronCalc – Open-Source Spreadsheet Engine by arjunlol on Saturday November 09, 2024 @04:49PM (#42097119)
Looks cool! What sort of different solutions do you imagine devs building on top of the engine?
Re:IronCalc – Open-Source Spreadsheet Engine by nhatcher on Saturday November 09, 2024 @05:32PM (#42097329)
One of the recurrent topics is integration with spreadsheets done by non-developers.

Imagine a spreadsheet built by the finance department of an institution. It is also maintained by them. The developer team might want to integrate this tool in their workflow. With IronCalc the can add units test or compute it a thousand times, one for each user.

I don't think developers would choose IronCalc to do any actual development. They will be forced to by other parts of their tool chain being spreadsheets.

Another way would be developers wanting to build spreadsheets with some extensions for a company or organization. Imagine needing a spreadsheet that has a built in SAT solver (like https://github.com/shnarazk/splr). That would be easily built in IronCalc.

Not sure if any of those ideas convinces you :)

Re:IronCalc – Open-Source Spreadsheet Engine by madjam002 on Saturday November 09, 2024 @04:52PM (#42097127)
Do you see this as an alternative to OnlyOffice? I’m wondering if you’ve tried it and how you think this compares
Re:IronCalc – Open-Source Spreadsheet Engine by nhatcher on Saturday November 09, 2024 @05:17PM (#42097260)
I remember trying it out, yes. I yet need to do a serious comparative analysis.

For what I can see OnlyOffice is feature complete, it's a full office solution. The sheets component is way ahead from IronCalc.

On the plus side, IronCalc is way lighter. When you go to IronCalc you download < 1Mb (compressed), it is faster and able to load larger workbooks on the web. IronCalc is an engine, meaning you don't need a UI at all to run it.

I don't think IronCalc is an alternative today to OnlyOffice. At most one day might be an alternative to the sheets component.

Re:IronCalc – Open-Source Spreadsheet Engine by alexk101 on Saturday November 09, 2024 @05:21PM (#42097283)
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.
Re:IronCalc – Open-Source Spreadsheet Engine by nhatcher on Saturday November 09, 2024 @05:47PM (#42097393)
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 by hitradostava on Saturday November 09, 2024 @05:39PM (#42097355)
Amazing project. The question I have is why rust? Is the compiled WASM significantly faster than JS?
Re:IronCalc – Open-Source Spreadsheet Engine by nhatcher on Saturday November 09, 2024 @05:57PM (#42097446)
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 by Onavo on Sunday November 10, 2024 @01:30AM (#42098798)
There might be some tricks from Row Zero that you can borrow

https://news.ycombinator.com/item?id=39551064

https://news.ycombinator.com/item?id=41512270

Re:IronCalc – Open-Source Spreadsheet Engine by yowlingcat on Saturday November 09, 2024 @06:44PM (#42097616)
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.

Re:IronCalc – Open-Source Spreadsheet Engine by nhatcher on Sunday November 10, 2024 @06:43AM (#42099694)
> 1) Any plans for programmatic manipulation of pivot tables?

As soon as we possibly can

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

That is in place already! It is an MVP, so I haven't published all packages for all architectures but you can compile it from source:

https://github.com/ironcalc/IronCalc/tree/main/bindings/pyth...

https://pypi.org/project/ironcalc/

Re:IronCalc – Open-Source Spreadsheet Engine by negoutputeng on Saturday November 09, 2024 @09:52PM (#42098319)
nice project ! and attempt to modernize the spreadsheet tech stack. be warned though, that the feature-set of the modern spreadsheet is gigantic, with tentacles in hundreds of nooks and corners. Any attempt to play catch-up is a losing proposition. Hence you could position it so as not to directly compete with excel - in areas that are new or emerging.

trivia: js based https://ethercalc.net/ is in turn is derived from https://github.com/DanBricklin/socialcalc written by the spreadsheet inventor dan bricklin

Re:IronCalc – Open-Source Spreadsheet Engine by fermigier on Sunday November 10, 2024 @03:14AM (#42099056)
Fun fact: Audrey Tang, creator of Ethercalc, went on to become Minister for Digital Affairs for the Taiwanese government.
Re:IronCalc – Open-Source Spreadsheet Engine by nhatcher on Sunday November 10, 2024 @05:49AM (#42099525)
I've said this in some other comment. We can't and will never be as feature full as Excel. We want to find different use cases. A super light spreadsheet with MIT license that you can use anyway you want.

If I were to go closed source, for instance, I think I loose 90% of my selling points.

Re:IronCalc – Open-Source Spreadsheet Engine by mjrpes on Sunday November 10, 2024 @12:13PM (#42101278)
One of my dreams if I were to create my own web-based spreadsheet engine would be to make worksheets much more general purpose and not stuck in tab UI like Excel. You would be able to embed them separately in the page so multiple worksheets could be viewed at the same time. Example: you might have multiple small worksheets with financial summaries where the columns are slightly different. You could also do things like include text above/below worksheets, to present the data in a document-like format.
Re:IronCalc – Open-Source Spreadsheet Engine by jitl on Sunday November 10, 2024 @01:33PM (#42101702)
This is how Apple's Numbers.app works.
Re:IronCalc – Open-Source Spreadsheet Engine by Hashex129542 on Saturday November 09, 2024 @11:07PM (#42098515)
Nice :)

You've added xlsx format to export. Is it legally allowed?

Re:IronCalc – Open-Source Spreadsheet Engine by nhatcher on Sunday November 10, 2024 @12:55AM (#42098720)
Re:IronCalc – Open-Source Spreadsheet Engine by Hashex129542 on Wednesday November 20, 2024 @08:28PM (#42200087)
Thanks
Re:IronCalc – Open-Source Spreadsheet Engine by eviks on Saturday November 09, 2024 @11:14PM (#42098525)
Cool project!

Do you have a detailed list tracking compatibility with Excel?

Do you have any great ideas where you can surpass it (in one way you can use yours without UI)?

Re:IronCalc – Open-Source Spreadsheet Engine by nhatcher on Sunday November 10, 2024 @02:11AM (#42098894)
Thanks!

There is not a detailed tracking of all Excel features. But we track:

1. Function implementations: https://github.com/ironcalc/IronCalc/labels/Functions 2. Dynamic arrays, defined names, pivot tables, ...

Excel is huge we only aim at implementing a subset.

Re:IronCalc – Open-Source Spreadsheet Engine by eviks on Sunday November 10, 2024 @02:21AM (#42098918)
Exactly because Excel is huge it'd be nice to have such a detailed reference, grouped by type: functions, UI, scripting, built in analysis tools etc

And some features could reduce pressure re compatibility in other areas. For example, if you had some kind of wasm plugin system, then people could easily write the lacking functions in their favorite language without having to wait for the core to add such a function.

Re:IronCalc – Open-Source Spreadsheet Engine by nhatcher on Sunday November 10, 2024 @05:50AM (#42099531)
Thanks for the feedback. I will try to build a more detailed compatibility reference as you describe.
Re:IronCalc – Open-Source Spreadsheet Engine by bsenftner on Sunday November 10, 2024 @05:58AM (#42099558)
How does your project compare to:

https://bossanova.uk/jspreadsheet/v4/ which is the open source version of

https://jspreadsheets.com/

Serious question. I base a lot of work off the open source jspreadsheet. Curious about yours.

Re:IronCalc – Open-Source Spreadsheet Engine by nhatcher on Sunday November 10, 2024 @06:33AM (#42099662)
At the moment they are a full production ready product, we only have an MVP.

If and when we reach version 1.0 we might be comparable. And you might want to use one or the other. It its difficult to say who the two product will compare in a year from now but probably IronCalc will be lighter, easier to integrate, faster in computations but not so feature full.

Re:IronCalc – Open-Source Spreadsheet Engine by hotbutterscotch on Sunday November 10, 2024 @05:59AM (#42099563)
Hey, sorry for the noob question. What is the use case for this. Is it to integrate into webpages for rendering data in spreadsheets/tables ?
Re:IronCalc – Open-Source Spreadsheet Engine by sunshine-o on Sunday November 10, 2024 @05:36PM (#42103058)
Beautiful project. Congrats and thanks !