3 ms·
But dimensional analysis has an automatic method of transforming objects of one type to another. When you talk about "strongly typed", I think you mean the pro
by mturmon 14y ago
But dimensional analysis has an automatic method of transforming objects of one type to another. When you talk about "strongly typed", I think you mean the programming concept, in which there is no such automatic method.
- tikhonj 14y agoHmm, I don't see any reason why a type system couldn't have automatic conversions like this. I remember reading about a system recently where certain typing rules would actually insert runtime code. In this particular case, it was a type system for C that would insert runtime asserts if it couldn't prove things statically, but this approach would certainly work for converting between units as well. In fact, you can even bludgeon an existing type system like Haskell's--a language well-known for not being dependently typed--into doing automatic conversions with units. This is exactly what the unittyped package[1] does, in fact. It's actually very cool. [1]: http://hackage.haskell.org/package/unittyped-0.1 http://hackage.haskell.org/package/unittyped-0.1
- evincarofautumn 14y agoMany type systems do include a notion of automatic (implicit) conversion between types. This doesn’t preclude strong typing in the usual sense; then again, “strong” is kind of a soft term, which isn’t really used in type theory.