3 ms·
> More programming languages should be offer support for units, and more program should be using them. There is some solution for most programming languages:
by marbu 3y ago
> More programming languages should be offer support for units, and more program should be using them.
There is some solution for most programming languages:
https://gmpreussner.com/research/dimensional-analysis-in-programming-languages https://gmpreussner.com/research/dimensional-analysis-in-pro...
How well it works mostly depends on features of a programming language or it's compiler.
That said it's rare for a programming language to have a type system with extra features and unit checking support in it's standard library like F# or GNAT does:
https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/units-of-measure https://learn.microsoft.com/en-us/dotnet/fsharp/language-ref...
https://gcc.gnu.org/onlinedocs/gnat_ugn/Performing-Dimensionality-Analysis-in-GNAT.html https://gcc.gnu.org/onlinedocs/gnat_ugn/Performing-Dimension...