How to Recalculate a Spreadsheet
lord.io
lord.io
That's how you know you're reading a really solid tech piece and not some blogspam!
> Fortunately, I have no understanding of business, and so we’re going to look at further improvements anyway.
That line grabbed me the same way it did you. I think of Electron chat apps, and how JIRA pages take 15 seconds to load, all the while the UI is glitching and twitching and daring you to click early[0]. And the only reason it's allowed to continue is because very large and complicated processes have been built on top of them.
[0] (What I want to know is, how do these lazy-load UIs know I'm about to click before I do? Because the buttons seem to dodge my click with uncanny timing.)
Not to mention the whole UI taking forever to load, with the trash button seeming to be the last icon up.
I you ask me why I did this, I might grumble about Google becoming too powerful, and my desire to decouple my life from them. And that's true.
But the concrete thing that pushed me over the edge was the UI getting worse and worse and worse.
I'm sure there are a dozen great web mail services out there, but Fastmail is the one I landed on and it's been fantastic. But the moral of the story is that I might have stayed with "evil Google" longer if they also didn't screw up the UX.
It's not strictly the web interface that is better/faster/etc either. I get notifications from the Fastmail app for forwarded messages ~30-60 seconds before the Gmail app knows about the original.
This is one of the main reasons I have my own domain. When I migrated to Fastmail, I just had to tell Fastmail that I wanted it to handle mail from the domain, set the MX records at my domain's nameserver to point to Fastmail, add a TXT record there for SPF, and add some CNAME records for DKIM. Fastmail gives instructions for all that here [1].
There was no need to update any sites with my email address because my address did not change. And there will be no need to update any sites if I ever decide to move from Fastmail to some other mail service, or to go back to running my own mail server.
Even simpler, you can use Fastmail as your DNS provider. Then it is just a matter of registering a domain, and telling your registrar that Fastmail is your DNS provider. Fastmail takes care of setting up the mail-related DNS records then. Here are there instructions for this approach [2].
The only serious things I use addresses that aren't @mydomain for are things that I might need to receive email from in order to resolve problems with @mydomain.
I strongly recommend this approach.
[1] https://www.fastmail.com/help/receive/domains-setup-mxonly.h...
[2] https://www.fastmail.com/help/receive/domains-setup-nsmx.htm...
Nothing like JIRA or other really slow sites, but just enough to be noticeable and annoying. Like I could "feel" the JS-heavy frontend doing more than it needs to in order to display a list of emails, or show a single one. Meanwhile it's nagging me on the left to add contacts to my GTalk, or Hangouts, or whatever they keep renaming that thing to.
The whole tabbed inbox thing didn't really help me. There are some "promotional" emails that I want to see in my main inbox, but most I don't. But with the tab system, I still have to check it all the time to avoid missing the ones I care about. So instead of decluttering things, I now have more places to click on to see what I have.
There was something about them disabling Exchange support a few years back. This made emails arrive much slower in my inbox on my iOS native client. I can't remember the specifics of that, or if IMAP is now functionally equivalent, but I don't care anymore.
And I just really would like to see my inbox and the currently-selected message at the same time. AFAIK, you have to choose between the message list or a single message; can't see both.
-------
So, after typing all that, I just logged into it again to see if my complaints held up. It seems faster now. I discovered I can disable the tabbed inbox (probably always could). I can enable a right reading pane (probably always could), and change the theme to a dark background (again...).
I got it almost looking like my Fastmail setup. But they're 2 years too late, and the font rendering is kinda crappy on my non-HiDPI external display anyway
So I guess now the only reason I don't use Gmail anymore is because Google.
This is from the settings:
Labels
======
Organize messages with:
[ ] Folders: file each message into a single folder
[ ] Labels: add multiple labels to each message
Switch methods at any time. Folders will become labels and vice versa.
I don't use labels, so I don't know if it's the same as how Gmail does it. But multiple labels per message is a thing it looks like.And somewhere a product manager earns their bonus. Engagement! KPIs! metrics! Omg people really love this feature, they keep clicking on it <3
Man, Google is so frustrating to use.
In the biz we call that "an improved user experience"
https://www.microsoft.com/en-us/research/uploads/prod/2018/0...
I tried making the same point on reddit the other day
https://www.reddit.com/r/excel/comments/jpb2ud/edit_a_spread...
https://support.microsoft.com/en-us/office/let-function-3484...
Disclaimer: I work at Microsoft
It's a DAG-computing framework in JS that allows you to listen to updates in a compute graph. It's a set of legos that I used to build both a MobX clone (https://github.com/atlassubbed/atlas-munchlax) and a React clone (https://github.com/atlassubbed/atlas-mini-dom). React and MobX are actually the same thing mathematically: reactive DAGs, so they can both be built using the exact same abstraction.
Disclaimer, I'm one of the founders.
[1] https://github.com/handsontable/hyperformula [2] https://handsontable.github.io/hyperformula/guide/key-concep...
And we will integrate it with our other product, Handsontable.
It should be fairly easy to make any integration. If not, then we will be happy to help.
So far I have mostly seen people integrate it with vanilla JS and Node. Any framework should be possible, as long as the data CRUD operations are performed through the HyperFormula API.
https://docs.microsoft.com/en-us/office/client-developer/exc...
Every instance of OFFSET in your sheet is recalculated after each cell change. I learnt that the hard way.
For example, OFFSET(B2,1,1,1,1) is a live reference to cell C3, which means you can use functions like COLUMN to investigate the range. C3 shows up nowhere in the formula, so there's no non-volatile way to implement it.
The first argument to INDEX is a "sqref" (cell, range, or set of ranges) and INDEX will error if you try to reference a cell outside of the sqref, so use of INDEX doesn't break the obvious dependency structure
There is no way you can keep track of what they are all about. You would have to try to search for relevant ones. Some people say that should be easy in these modern days of computers. You could search for key words and so-on. That one works to a certain extent. You will find some patents in the area. You won't necessarily find them all however. For instance, there was a software patent which may have expired by now on natural order recalculation in spread sheets. This means basically that when you make certain cells depend upon other cells, it always recalculates everything after the things it depends on, so that after one re-calculation, everything is up to date. The first spread sheets did their recalculation top-down, so if you made a cell depend on a cell lower down, and you had a few such steps, you had to recalculate several times to get the new values to propagate upwards. You were supposed to have things depend upon cells above them. Then someone realized why don't I do the recalculation so that everything gets recalculated after the things it depends upon? This algorithm is known as topological sorting. The first reference to it I could find was in 1963. The patent covered several dozen different ways you could implement topological sorting but you wouldn't have found this patent by searching for spreadsheet. You couldn't have found it by searching for natural order or topological sort. It didn't have any of those terms in it. In fact, it was described as a method of compiling formulas into object code. When I first saw it, I thought it was the wrong patent.”
— Richard Stallman, 2002 (https://www.gnu.org/philosophy/software-patents)
It's hard to believe that topological sort (available in the GNU `tsort` and `make` apps, for example) was ever patentable.
Perhaps Wikipedia contains references to published prior art?
If they don't even look at everyone else's registered-as-unique ideas, how could they have been knowingly infringing?
Everyone wants their cut of Progress in the Useful Arts and Sciences. Nobody will invalidate patents for everyone else; USPTO has no obligation to even check a search engine for the subject matter.
And then, prove the date that published prior art was published without a distribted time-stamping blockchain. Find the nonce that makes it all worth it!
Topological Sort: https://en.wikipedia.org/wiki/Topological_sorting
Reactive programming: https://en.wikipedia.org/wiki/Reactive_programming
DOM implementations typically don't repaint the whole screen. (All browsers do graph traversal in order to determine what to redraw or draw first): https://en.wikipedia.org/wiki/Document_Object_Model#Implemen...
Also, in most spreadsheets (certainly at the time), evaluating in top to bottom, left to right order is the correct way. That the code had to go through all cells a second time to discover that you’re done didn’t matter, given that there were no other processes that could want to use the CPU, as long as you interrupted calculations on key presses.
Also, I’m not sure 123 beat VisiCalc because of its smarter recalculation. I think it were the charts and its macro system (awful by today’s standards, but way better than nothing)
In the past I've implemented dirty marking and, while fun to figure out the appropriate logic, topological sorting seems much neater.
https://www.janestreet.com/tech-talks/seven-implementations-...
At the same time, we’ve struggled to find decent reference material or libraries for building a reactive framework for X (for our use case, X = data science workflows). Most of these libraries seem to implement all the primitives from scratch.
I’d be interested to here other people’s thoughts on this!
This was the major motivation for us to create
- a platform for visual reactive programming, working in your browser.
ObservableHQ was obviously an inspiration, but we concentrated on making it more production oriented: you can literally build a fully-fledged web application without leaving your browser, around solid reactive abstractions.
Some examples built with Ellx:
[1] https://ellx.io/matyunya/tensorflowjs-simple-demo
Around 2000 we had to make a spreadsheet in Java as an assignment in an introductory programming class. That it would be calculated in "demand-order" was such an obvious requirement it wasn't even mentioned in the assignment. This says something about what modern tools and languages does (Not that Java and Swing feels all that modern any more). Because they surely understood the problem way better than introductory programming students 20 years later.
Most other Javascript spreadsheet products are slow even without formulas, with a very slow DOM structure.
It is much slower than Microsoft Excel and WPS Office for complex loads [1, 2]
[1] https://github.com/amzn/computer-vision-basics-in-microsoft-...
https://observablehq.com/@observablehq/how-observable-runs
Here’s the runtime source:
To be honest you lost me at the end with the burrito code, I was left wondering why we have burrito code in our spreadsheet calcs.
- everything you write is an expression that yields a value
- those expressions are "pure"/"referentially transparent" bc there's no way to do side effects (like writing to another cell)
the whole "recalculate value if any dependency changed" thing would probably fall more under "reactive" systems - you need the notion of inputs that a user can change.
but you're right that efficient recalculation is enabled by the calculations being side-effect-free! we know that changing a cell can only influence cells that reference it, so we only need to recalculate those, not the whole spreadsheet!
Bravo.