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
elcritch1 reply#
Looks nice! Making the result blocks non-text is handy. Any plans to open source this or sell a desktop version? I've long been a fan of http://calca.io but it doesn't run on Linux. There's some other versions out there but they tend to be flaky.
tonyonodi1 reply#
Glad you like it! I've got a desktop version in the works, and if the web version gets enough interest I'll finish it off.
Aeolun#
Finish it off sounds like you are going to kill it ;)
joeframbach1 reply#
I'm trying to figure out how many "miles per hour" I get while charging my vehicle. I have a 3.3KW charger and I average 3.1 miles per KWh while driving. I expect that I am charging at a rate of 10.23 miles per hour.

So

    3.3 KW * 3.1 miles per KWh
Says "3.3". The math is wrong and the units are gone.

Actually, it doesn't seem to understand the concept of a KW. I'll try "kilowatt" and "kilowatt-hour" respectively.

    3.3 kilowatt * 3.1 miles per kilowatt-hour
Says "Incompatible units".

The closest I got was

    3.3 kilowatt * 3.1 miles per kiloWh
Says "10.23 kW mi".

insect.sh is able to do that last one.

    3.3 kilowatt * 3.1 miles per kiloWh
    3.3 kW × (3.1 mi / kW·h)
    = 10.23 mi/h
xaos#
The "kilo" prefix is a lowercase k. If you fix that, it works perfectly: "3.3 kW * 3.1 miles per kWh"

Gives "10.23 kW mi / kWh" as you expected
I guess ideally you would want it to factor out the kW.

shreyshnaccount2 replies#
THIS IS AMAZING. the next step is adding variables and assignments and conditionals, and you have something very powerful that can be used by just about anybody to do really interesting things. provided you have a way to integrate with other services that a lot of people use
janjones1 reply#
Variables and assignments are already supported.
shreyshnaccount#
should rephrase, meant to say (variables, assignments) AND conditionals
tonyonodi1 reply#
Thanks! Turning the current language into a Turing complete one would be a huge step up in complexity and I'm not sure it will ever make sense to implement. But I have thought about adding the ability for users to define their own functions in JS and might get around to that one day.
shreyshnaccount#
I see. despite my not totally unjustified hate of Javascript, Im looking forward to it.
unnouinceput#
One thing it's missing which is trivial to implement. Have a little checkbox adjacent to line numbers, default true, that when unchecked would simply not parse the calculations, just leave it as simple text.

This way writing "and here is a little example of 9^9^9" and simply copy paste that to next line would allow me to not have it evaluate on text, but only on next line. OF course, a little more complicated to implement would be next step of actually select the text and within the pop-up have "Don't evaluate". This way writing a documentation without having always calculation be in your way would be very easy.
Other than that, this looks great ma' dude. Keep it up!

Load more comments