4 ms·
Hm, that's very interesting, thanks. I think I'm approaching this from a physics perspective, where units and dimensional analysis are very important, and there
by heisenzombie 5y ago
Hm, that's very interesting, thanks. I think I'm approaching this from a physics perspective, where units and dimensional analysis are very important, and there's a very specific formalism and philosophy involved. For example, dimensionless quantities are deeply meaningful -- see the Buckingham pi theorem for example.
On the other hand, I think this library seems very pragmatic: It doesn't match my "rigorous" ideas about units but that's fine because it's actually trying to do something else.
As I understand it, the idea is that I can't /necessarily/ give a quantity of "250 mm" to a function that expects a length because, for example, the quantity might be of category "rod length" and the function expects a "cylinder width". The /units/ match, but the /category/ does not.
That's very interesting and I see why it's useful. It strikes me as trying to be something like a type system, with pre-defined types for physical units that you "subclass" or "parameterize". I think this is something I will think about quite a bit more.
I should also thank you because (over) thinking about this has already led me to discover the idea of "parametric units":
http://ingvar.web03.cefit.se/wp-content/uploads/2016/02/physics6.pdf http://ingvar.web03.cefit.se/wp-content/uploads/2016/02/phys...
... which seems related even if I can't quite put my finger on exactly how.