frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: I made a spreadsheet where formulas also update backwards

https://victorpoughon.github.io/bidicalc/
43•fouronnes3•1d ago
Hello HN! I'm happy to release this project today. It's a bidirectional calculator (hence the name bidicalc).

I've been obsessed with the idea of making a spreadsheet where you can update both inputs and outputs, instead of regular spreadsheets where you can only update inputs.

Please let me know what you think! Especially if you find bugs or good example use cases.

Comments

remywang•1h ago
A bidirectional formula is also known as an integrity constraint in databases (plus some triggers for restoring the constraint upon updates)!
PaulHoule•1h ago
Wow! See the classic https://en.wikipedia.org/wiki/TK_Solver
kccqzy•1h ago
I think the concept is solid. I’ve only had a few minutes of playing with it, but I have the opinion is that from a UX perspective constants are more common than variables. So perhaps a cell containing a constant should not have a #, but a variable should.
WillAdams•1h ago
Very cool!

I'd love to see a version where cells are "torn off" and named as they were in Lotus Improv and one had a "formula pane" where one could see all the formulae for a spreadsheet.

Would it be possible to create this in Python so that it could be a part of pyspread?

throw310822•1h ago
Hm? I don't get it.

What's the point of calculating backwards non-invertible operations such as addition? Isn't the result just arbitrary?

generalizations•1h ago
They said this:

> Even a normal spreadsheet is fairly complex beast. But the novel thing about bidicalc is the backwards solver. Mathematically, updating a spreadsheet "backward" is a (potentially underdetermined) root finding problem, because we are trying to find a vector of unknowns such that , where F is the function computed by the cells formulas, and G is the objective value entered in the cell. Note that F is not necessarily a single formula, but the result of composing an upstream graph of cells into a single function.

> The actual root-finding solver is a custom algorithm that I made. It a general purpose algorithm that will find one root of any continuous-almost-everywhere function for which a complete syntactic expression is known. It uses a mix of continuous constraint propagation on interval union arithmetic , directional Newton's method and dichotomic search. It is of course limited by floating point precision and available computation time.

But that really doesn't answer your question. I see no reason why the solver wouldn't decide every time it had a two-variable summation that ADD(X+Y) doesn't reverse to X=-90 and Y=100.

fouronnes3•1h ago
I made this mostly as a fun challenge :)

You are right that there is some arbitrariness involved when picking a solution, however it's a bit more subtle than that.

Let's say our problem has N free variables.

Step 1 is finding the subset of R^N that is the solution to the root finding problem. If this subset is a point, we are done (return that point). Note that if there is no solution at all bidicalc should correctly report it.

Step 2 is if the solution subset is not a point. Then there is multiple (maybe even an infinity of) solutions, and picking one is indeed arbitrary.

kolarski•16m ago
does the algorithm tries to make minimal changes to the free variables ? If we have 1 + 1 = 2 and change 2 -> 4 then -100000 + 100004 = 4 is also a valid solution. When I tried it it changed it to 2 + 2 so perhaps there is optimization but also a valid optimization can be minimal free variable changes in which case it would be 1+3 = 4 and we update 1 free variable instead of 2. I have no idea which is better just curios how it works. I like the idea very much.
willrshansen•1h ago
The first example on the main page has a formula with two variables being updated from changing one value. The immediate question I have is if I change the output, where does the extra degree of freedom come from on the inputs? Does one stay locked in place? Unclear.

I am a huge fan of the concept though. It's been bugging me for years that my spreadsheet doesn't allow editing text fields after filtering and sorting them down to the subset I want. I have to go all the way back to the mess of unsorted input rows to actually edit them.

jy14898•54m ago
you might like https://omrelli.ug/g9/ which is a similar concept but for graphics
fouronnes3•53m ago
I do like g9! It was a strong inspiration for bidicalc actually!
thomastay•25m ago
This is really cool! It's like Excel's goal seek but can also handle the case of arbitrary input cells. Goal seeek can only handle one input and one output cell.

But how do you handle the case where multiple variables can be changed? If multiple input cells is the key difference from Goal seek, i think some more rigor should be placed into the algorithm here

e.g. setting A1 + B1 and wanting the result to be 5. Currently it bumps both A1 and B1 equally. What's the thought process behind this?

fragmede•13m ago
Yeah. The UI could have a lock icon to indicate that, eg B1 should stay the same and only A1 can be moved.
aatd86•19m ago
LOL! Gemini suggested to implement this to me literally yesterday: bidirectional computations. The example was that given a temperature in Celsius and Fahrenheit, modifying either of them should update their counterpart. In angular that would be two linked signals for instance, but even that is a bit fringe. Gemini was going for something even more elaborated.

I told Gemini that spreadsheets were actually not doing that and that I had ways to implement that behavior without the complexity.

Just writing that to show the rabbit hole people are going to fall into if they let their llms go brrr. ;D

b-karl•19m ago
In Excel you have goal seek for this functionality. I believe it does some form of numerical solving of the equation system.

Good for every situation when you need to solve equations!

In the context of using spreadsheets I think about solving simple financial or maybe construction/mechanical design problems where you don’t want to solve it manually or program it and a spreadsheet is a quick and useful interface.

Show HN: Tiny VM sandbox in C with apps in Rust, C and Zig

https://github.com/ringtailsoftware/uvm32
60•trj•3h ago•3 comments

Show HN: I made a spreadsheet where formulas also update backwards

https://victorpoughon.github.io/bidicalc/
44•fouronnes3•1d ago•15 comments

Show HN: Tripwire: A new anti evil maid defense

https://github.com/fr33-sh/Tripwire
73•DoctorFreeman•1d ago•38 comments

Show HN: EdgeVec – Sub-millisecond vector search in the browser (Rust/WASM)

https://github.com/matte1782/edgevec
4•matteo1782•2h ago•1 comments

Show HN: PharmVault – Secure Notes with Spring Boot and JWT

https://github.com/nifski/PharmVault
3•nifemi1234•2h ago•3 comments

Show HN: Autofix Bot – Hybrid static analysis and AI code review agent

32•sanketsaurav•1d ago•12 comments

Show HN: I built a GitHub application that generates documentation automatically

https://codesummary.io
4•jerrodcodes•3h ago•1 comments

Show HN: Verani – Socket.io-like realtime SDK for Cloudflare

https://github.com/v0id-user/verani
4•v0id_user•4h ago•0 comments

Show HN: PhenixCode – Added admin dashboard for multi-server management

https://github.com/nesall/phenixcode
2•nesall•4h ago•0 comments

Show HN: Local Privacy Firewall-blocks PII and secrets before ChatGPT sees them

https://github.com/privacyshield-ai/privacy-firewall
104•arnabkarsarkar•3d ago•54 comments

Show HN: Storyloom – Deterministic Storytelling Framework

https://jcpsimmons.github.io/storyloom/
3•joshcsimmons•5h ago•0 comments

Show HN: Sim – Apache-2.0 n8n alternative

https://github.com/simstudioai/sim
229•waleedlatif1•1d ago•57 comments

Show HN: I'm building an open-source Amazon

https://openship.org
6•theturtletalks•6h ago•0 comments

Show HN: ESLint Plugin for styled-jsx

https://github.com/sushichan044/eslint-plugin-styled-jsx
3•sushichan044•6h ago•0 comments

Show HN: Jottings; Anti-social microblog for your thoughts

https://jottings.me/
22•vishalvshekkar•16h ago•12 comments

Show HN: Epstein's emails reconstructed in a message-style UI (OCR and LLMs)

https://github.com/Toon-nooT/epsteins-phone-reconstructed
41•toon-noot•12h ago•8 comments

Show HN: Euporie-lite, Jupyter notebooks in terminal in the browser

https://euporie.readthedocs.io/en/latest/_static/lite.html
3•joouha•8h ago•1 comments

Show HN: Dbxlite – Query 100M+ rows in a browser tab, no install

https://sql.dbxlite.com/?share=gist:f0377982ccd68ac7f61a7faef8ff513e&run=true
2•hfmsio•8h ago•1 comments

Show HN: A zero-to-hero, spaced-repetition guide to WebGL2 and GLSL

https://github.com/GregStanton/webgl2-glsl-primer
3•HigherMathHelp•8h ago•1 comments

Show HN: Wirebrowser – A JavaScript debugger with breakpoint-driven heap search

https://github.com/fcavallarin/wirebrowser
67•fcavallarin•2d ago•15 comments

Show HN: Gemini Pro 3 imagines the HN front page 10 years from now

https://dosaygo-studio.github.io/hn-front-page-2035/news
3317•keepamovin•3d ago•957 comments

Show HN: A 2-row, 16-key keyboard designed for smartphones

https://k-keyboard.com/Why-QWERTY-mini
81•QWERTYmini•2d ago•68 comments

Show HN: Automated license plate reader coverage in the USA

https://alpranalysis.com
237•sodality2•2d ago•146 comments

Show HN: GPULlama3.java Llama Compilied to PTX/OpenCL Now Integrated in Quarkus

23•mikepapadim•1d ago•5 comments

Show HN: An endless scrolling word search game

https://endless-wordsearch.com
25•marcusdev•1d ago•14 comments

Show HN: Open-source, offline voice typing and live captions for Android

https://github.com/notune/android_transcribe_app
3•leumon•11h ago•0 comments

Show HN: Gotui – a modern Go terminal dashboard library

https://github.com/metaspartan/gotui
40•carsenk•1d ago•13 comments

Show HN: 360css CSS library inspired by the xbox360 dashboard

https://tarmo1.github.io/360css/
3•Tarmo362•12h ago•0 comments

Show HN: AlgoDrill – Interactive drills to stop forgetting LeetCode patterns

https://algodrill.io
177•henwfan•3d ago•106 comments

Show HN: I built a system for active note-taking in regular meetings like 1-1s

https://withdocket.com
175•davnicwil•4d ago•130 comments