
Ask HN: Where are the unit-typed languages? - univacky
Are there any programming languages that treat, say, numbers like adjectives, as human languages do, and have units typing?<p>Instead of an integer being a standalone noun, &quot;5&quot;, it would be &quot;5 apples&quot;, or &quot;5 meters&#x2F;second&quot;.  Multiplying a variable of 3 meters&#x2F;second by a variable of 2 minutes could give a result of 180 meters, and adding nautical miles to dollars would give an exception.  I&#x27;ve played around with this idea a little bit in objects, but it seems like a language with such features built in  or an object library should already exist somewhere.
======
kognate
You can do this sort of thing with Ada's type system. There is also a blog
post about units of measure in F#
[https://blogs.msdn.microsoft.com/andrewkennedy/2008/08/29/un...](https://blogs.msdn.microsoft.com/andrewkennedy/2008/08/29/units-
of-measure-in-f-part-one-introducing-units/)

It's a pretty niche topic. You can do this in a language like c++ or even
python but unit aware calculations aren't a requirement for a lot of systems.

------
blandflakes
Have you seen [https://frinklang.org/](https://frinklang.org/) ? I think
that's supposed to be its Big Idea.

