Live data from Hacker News

GNU Units

gnu.org

1–10 of 117 posts

Re: GNU Units

#4
post #2

This tool is underrated. Failing to deal with units conversion already crashed a Mars probe: https://www.latimes.com/archives/la-xpm-1999-oct-01-mn-17288... I wonder if the recent problem with the voyager was due to something like this, for example, 2 arcminutes or 2*pi radians being mistaken for 2 degrees.

>This tool is underrated. Failing to deal with units conversion already crashed a Mars probe

The mistake there was that they were unaware that they had to make the unit conversion, not that they did it wrong.

No tool can, by itself, overcome your ignorance of its necessity.

Re: GNU Units

#5
I haven’t looked at the code for this but somehow I think the conversion problem is very similar to a graph search. If you build a graph in which the vertices are the units and the edges are compatible convert scales, you can use this graph with say, BFS to find the right traversal path. Multiplying the scales would get you the result converting from a unit to another. Or, dividing would give you the reversed conversion. I used to think we could use a hash table for this kind of stuff. It is faster of course but you need to account for all sort of conversion, even the crazy ones like Lightyear to feet’s, for instant. With the graph, I think I could just throw everything in it. No matter how crazy the conversion is, if there is a path, you will get it!

How does GNU unit get the conversion tables to bootstrap, does anybody know?

Re: GNU Units

#6
post #4
post #2

This tool is underrated. Failing to deal with units conversion already crashed a Mars probe: https://www.latimes.com/archives/la-xpm-1999-oct-01-mn-17288... I wonder if the recent problem with the voyager was due to something like this, for example, 2 arcminutes or 2*pi radians being mistaken for 2 degrees.

>This tool is underrated. Failing to deal with units conversion already crashed a Mars probe The mistake there was that they were unaware that they had to make the unit conversion, not that they did it wrong. No tool can, by itself, overcome your ignorance of its necessity.

> No tool can, by itself, overcome your ignorance of its necessity.

A type system that understands units of measurement can help:

https://learn.microsoft.com/en-us/dotnet/fsharp/language-ref...

Re: GNU Units

#7
Units of measure are, of course, the aboriginal type system for pre-software hand calculation.. carrying units along to make sure you do not add apples to oranges { unless you know how to convert "apples" to "oranges" for some adapted metaphorical fruits.. e.g. orange section/segment/slices :-) }.

Nim [1] has sufficient compile-time strength that units can be integrated with the static type system: https://github.com/SciNim/Unchained

[1] https://nim-lang.org/

Re: GNU Units

#9
post #4
post #2

This tool is underrated. Failing to deal with units conversion already crashed a Mars probe: https://www.latimes.com/archives/la-xpm-1999-oct-01-mn-17288... I wonder if the recent problem with the voyager was due to something like this, for example, 2 arcminutes or 2*pi radians being mistaken for 2 degrees.

>This tool is underrated. Failing to deal with units conversion already crashed a Mars probe The mistake there was that they were unaware that they had to make the unit conversion, not that they did it wrong. No tool can, by itself, overcome your ignorance of its necessity.

> The mistake there was that they were unaware that they had to make the unit conversion, not that they did it wrong.

I think the root cause here was continued use of medieval units, instead of just standardizing on the metric system as it's already done around nearly the entire world.

Post reply on HN