Lurker News
Hi HN

It also supports percentages, dates and variables.
I've been working on this alone for a few years now, so would love to get some feedback.

Comments (239) 97 threads

Earlier comments
skeoh#
Super cool and congrats on shipping! Something I'd love to see is the ability to embed a document on other sites via iframes a la GitHub Gist embeds. That way I could, say, write a blog post describing an algorithm, embed an example of the calculations, and allow visitors to tweak the values and see how they affect the output. Well done!
OJFord1 reply#
This is great, I use `bc` a lot at work (particularly when away from desk and my actual calculator) but I'll probably bookmark this to use instead.

One bit of very minor feedback:
`x^y tonnes` errors 'exponent must be unitless'. The more expected (IMO) grouping `(x^y) tonnes` works, so why not have the non-error grouping be the implied one, when no parens given?

tonyonodi#
I hadn't thought about that before but I think you're right, I've added it to my roadmap.

Getting operator precedence right has been pretty fraught tbh. For example "1km / 3 hours" is evaluated as "(1km) / (3 hours)", but "1 / 3 hours" is evaluated as "(1 / 3) hours", which is odd from a PL perspective, but I think it's more intuitive from a user perspective for this sort of thing.

0xRusty3 replies#
It's very nicely done, but I'm afraid I don't "get it" with things like this and written out calculators in general. Why would I type out something long like:

" Alice's food = £30 Bob's food = £25 VAT = 20% Alice's food + Bob's food + VAT "
Rather than just punch (30+25)*1.2 straight into a calculator?

wccrawford1 reply#
Maybe you want to store all that information for later and also want the calculation, both now and later?
0xRusty1 reply#
So...a spreadsheet?
samwhiteUK#
A spreadsheet won't automatically work out and display units for you
samatman#
I've found that the Calca[†] format hits a nice sweet spot between using an ordinary calculator and running a spreadsheet.

[†]: http://calca.io
It's particularly suited to calculations I'm doing by fetching various numbers from websites, and for the most part it 'composes' by just copypasting a calca into another one.
Basically where the numbers mean something, aren't stable / I don't know them all when I start, but there's no tabular data or significant aggregation going into the question.

BWStearns#
I can see this being useful as a narrative document for collaboration. Explaining to someone how a business process might work given x/y/z pricing. Easy to embed the "why" aspects of things but also it autocalcs things so they could play with the numbers and see the change in impact. Some people can "think in spreadsheet" (I'm quite happy there) but that's not the best medium for everyone.
harpiaharpyja1 reply#
Very cool! Any plans to support vector/matrix operations? I occasionally do some work with 2D/3D graphics or physics and having some basic linalg would be nice.

I can see myself using this a lot as a scratch pad to hash out ideas while implementing stuff. The ability to define custom functions would be very helpful for that.

tonyonodi#
It's something I've thought about but I'm not sure I'm going to implement it for a while as it would be quite a big undertaking. The same is true of complex numbers unfortunately.

Load more comments