News for hackers. Stuff that matters.
Re:Ask HN: Whatever happened to Wolfram Alpha? by 5- on Saturday November 06, 2021 @04:55PM (#29133730)
you might want to try units(1).

https://www.gnu.org/software/units/units.html

the input language is less flexible than wolframalpha/google, but i quickly got used to it. it's nice to have something local and reliable. you can also define custom units.

i prefer using it in terse mode:

    $ units -t 0.03$/hr*1month
    21.914532 US$
    $ units -t 10TB/month Mbps
    30.421214
Re:Ask HN: Whatever happened to Wolfram Alpha? by nimih on Saturday November 06, 2021 @09:07PM (#29135474)
qalc[1] is also quite nice if you're looking for a command line calculator; it handles units well, but has some other fancy features, and has a very lax parser which i find to be a huge plus.

    $ qalc '0.03$/hr*1month'
    error: "r" is not a valid variable/function/unit.
    (0.03 × (USD / hour)) × (1 × month) = $21.915

    $ qalc '0.03$/h*1month -> CAD'
    (0.03 × (USD / hour)) × (1 × month) ≈ CAD 27.28388011

    $ qalc '10TB/month -> Mbit/s'
    10 × (terabyte / month) ≈ 30.42056430 megabits/s

    $ qalc 'integrate(x+x^2)'
    integrate(x + (x^2)) = x^3 / 3 + x^2 / 2 + C
[1] https://qalculate.github.io/manual/qalc.html
Re:Ask HN: Whatever happened to Wolfram Alpha? by every on Saturday November 06, 2021 @08:11PM (#29135121)
Units advises there are 118.20896 smoots per furlong..
Re:Ask HN: Whatever happened to Wolfram Alpha? by sokoloff on Saturday November 06, 2021 @08:57PM (#29135404)
Wouldn’t that be properly expressed as 118 Smoots plus 5 Ears?
Re:Ask HN: Whatever happened to Wolfram Alpha? by artursapek on Saturday November 06, 2021 @08:29PM (#29135229)
people still measuring in smoots smh
Re:Ask HN: Whatever happened to Wolfram Alpha? by avmich on Saturday November 06, 2021 @06:17PM (#29134338)
For calculator problems like that, I use J:

   */ 0.03 24 30
21.6

   1e6 %~ (10e12 * 8) % */ 30 24 3600
30.8642

Usually requires some massaging, but still takes seconds.

Re:Ask HN: Whatever happened to Wolfram Alpha? by kragen on Saturday November 06, 2021 @11:57PM (#29136441)
While APL dialects are very nice for this sort of thing, they generally don't understand units of measure or know about physical constants; you have to put those into them yourself. Here are some of my recent units(1) queries:

    141 pounds force 30 mm  # in joules
    1160/4
    log(3)/3/(log(2)/2)  # how much more efficient is one-hot ternary than one-hot binary?
    5V 7 μs / 7.3 A
    .0117% half avogadro mol / 1.251e9 years / (potassium+chlorine)g  # how radioactive is lite salt?
    3.27$/gallon  # in $/liter
    sqrt(2 2000 electronvolt/electronmass)
    18.8 foot pounds force # in joules
    163$/(7.9 g/cc * 1500 mm 3000 mm 3.2 mm)  # cold rolled steel price is higher than steel sold by weight
    m3/4 / 15 cfh
    2 pi sqrt(200 um / gravity)
Re:Ask HN: Whatever happened to Wolfram Alpha? by Siira on Tuesday November 09, 2021 @12:09PM (#29164324)
Julia is also excellent for working with units (Units.jl, IIRC).
Re:Ask HN: Whatever happened to Wolfram Alpha? by ChrisRackauckas on Tuesday November 09, 2021 @04:39PM (#29167857)
Unitful.jl