3 ms·
> Your last point is what I was trying to get at — eg, reasoning just about your math expressions. I think it's borderline criminal that programming languages
by naasking 1y ago
> Your last point is what I was trying to get at — eg, reasoning just about your math expressions.
I think it's borderline criminal that programming languages haven't added units of measure to their type systems yet, and then required every numerical type to be associated with a unit. We've known how to do this for decades now. All numerical code has latent units: either a specific unit, or polymorphic over the unit (like scalar transforms). Even memory copies and moves operate on byte units.
- rocqua 1y agoC++29 is considering adding units. Currently, apparently, available in this library: https://mpusz.github.io/mp-units/HEAD/ https://mpusz.github.io/mp-units/HEAD/
- naasking 1y agoGreat news if true, but I'm not holding my breath. Just adding units support doesn't quite go far enough, but C++'s backwards compatibility prevents it from enforcing the stronger requirement I mentioned.