Show HN: I rewrote my notepad calculator as a local-first app with CRDT syncing
31 points
3 days ago
| 7 comments
| numpad.io
| HN
I launched NumPad v1 on here a few years ago, and back then it wasn't much more than a thin CodeMirror wrapper around the calculator engine I'd written.

Now I've rewritten it as a PWA that supports multiple documents, persists them to IndexedDB, and has a syncing service for paying customers. Syncing is handled by Automerge[1] under the hood, which should make it relatively easy to get document sharing working too.

[1] https://automerge.org/

zamadatix
1 hour ago
[-]
Super clean style of interaction regarding the units and general syntax.

Regarding the CRDT side of things what's the main driver? Syncing is probably better off without CRDT (I'd rather know a note had 2 copies significantly edited differently and now I have a sync conflict rather than no sync conflict but a hacked up note) so I'm assuming paid customers get (or will soon get) live multi user editing (i.e. you can trade local for concurrent usage)

reply
johncosta27
3 days ago
[-]
This is very cool. I was able to so some a small budget to see what my expenses are monthly, it's quite nice. I can see myself using it anytime I need something more than paper, and less than a full spreadsheet. Very cool.
reply
eps
6 hours ago
[-]
In two years on HN this is the post you deemed worthy of your second ever comment? Hmm.
reply
jasonjmcghee
6 hours ago
[-]
Clearly he likes notepad calculators.
reply
kragen
3 hours ago
[-]
Was the other one by a different author?
reply
eviks
1 hour ago
[-]
Unfortunately doesn't support superscripts 6²

Also is it possible to use CRDT as rich undo history, not only syncing?

reply
abfar
3 hours ago
[-]
Nice tool, but the calculator executes division before exponentiation. E.g. 2^4/2 is evaluated to 4, not 8. However, it executes exponentiation first before multiplication (e.g. 2^2*3 is evaluated to 12). Is this intentional?
reply
bobeboph
3 hours ago
[-]
This is intentional, even if unexpected, as shown in line 152 of the link (turn on line numbers in the settings menu). I agree that following PEMDAS would make more sense.

Edit: it's the equation below "Although if you want to find roots higher than 3..."

reply
zamadatix
1 hour ago
[-]
Maybe the author did intentionally break order of operations for shorthand on other roots, maybe they just forgot that's not how it's normally parsed. 152 doesn't comment on intent one way or the other, it just demonstrates how it currently is.
reply
kragen
3 hours ago
[-]
That's pretty nice; I've made a few attempts at such things myself, but the UI flow seems pretty smooth.

What's the license? I wouldn't want to use your code if copyright law poses a threat.

reply
ajjenkins
3 hours ago
[-]
This is really cool. I’m not sure what I would ever use it for, but it’s a cool idea and seems well executed.
reply
wslh
5 hours ago
[-]
Looking for other notepad calculators I found odd products like this: https://www.ubuy.com.ar/en/product/IP17JM9X0-calculator-with...
reply