On Sun, Apr 3, 2022, 6:27 PM Chris Angelico <rosuav@gmail.com> wrote:
On Mon, 4 Apr 2022 at 07:45, Ethan Furman <ethan@stoneleaf.us> wrote:
> Mechanically, are `lbs`, `km`, `hr`, etc., something that is imported, or are they tags attached to the numbers?  If
> attached to the numbers, memory size would increase and performance might decrease -- but, how often do we have a number
> that is truly without a unit?
>
> How old are you?  35 years
> How much do you weigh?  300 kg
> What temperature do you cook bread at?  350 F
>

Very frequently - it'd be called an index. (What sort of numbers
should enumerate() return, for instance? Clearly that, whatever it is,
is an index.) But if every int and float has a tag attached to it,
it's not that big a deal to have either a default tag, or leave the
field NULL or None, to define it to be a unitless value or index.

ChrisA

How much memory would have to be added to every number? Could it be dynamically sized so it doesn't have a large impact on all the code out there with no units? But also grow to be big enough to capture the vast constellation of units and unit combinations out there?

I'm unsure simple tags are enough. What should the behavior of this be?

height = 5ft + 4.5in

Surely we ought to be able to add these values. But what should the resulting tag be? Should we be able to write it like this?

height = 5ft 4.5in

I was cheerleading this effort earlier and I still think it would be a massive contribution to needs of the engineering world to solve this problem at the language level. But boy howdy is it a tough but of a problem to crack.