4 ms·
Is this still true if you're using metric? Just curious, as the Frink examples were all imperial. And examples like `10 feet 12 feet 8 feet -> gallons` are muc
by stevage 2y ago
Is this still true if you're using metric?
Just curious, as the Frink examples were all imperial. And examples like `10 feet 12 feet 8 feet -> gallons` are much less compelling in metric (eg, 3 metres x 4 metres x 2 metres in cubic metres is, uh, 24 cubic metres...)
- genter 2y agoThere's lots of metric units that aren't obvious when multiplied. For example, watts = ohms * amps^2 (very important if you want to calculate how much heat a mosfet is going to dissipate.)
- synapsomorphy 2y agoDunno about Frink but both qalc and pint allow any units and mixing and matching, in qalc you can do something like `1in^2 * 1m to gal` or `1 ly / fortnight to mph` and get as complex as you want. I use metric except when converting to vendor units for component speccing.
- ericyd 2y agoIMO dimensional analysis is still useful even if unit conversions are more compatible.
- Y_Y 2y agoI agree with this sentiment, and in fact have always thought of it as analogous to type-checking (which must programmers benefit from to some extent). If you use something with a sufficiently flexible type system you can combine these benefits, for example Haskell will let you mix physical units into the type system and have them statically checked: https://wiki.haskell.org/Physical_units https://wiki.haskell.org/Physical_units
- schiffern 2y ago>Just curious, as the Frink examples were all imperial. No worries. Internally Frink immediately converts everything into SI, actually. Fortunately Frink converts with zero loss of precision, because the language supports exact rational numbers. The unit definitions are all given in exact rationals, since they are (legally) defined as exact multipliers. For readability Frink introduces the "ee" ('exact exponent') notation, so for instance the standard acceleration due to gravity can be given as: 9.80665ee0 m/s^2 or (equivalently) in simplest form, as: 196133/20000 m s^-2 Frink treats these two quantities as exactly equivalent.