3 ms·
I can't resist mentioning F# Units of Measure aka UoM :) https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/units-of-measure https://learn.micr
by evntdrvn 3y ago
I can't resist mentioning F# Units of Measure aka UoM :)
https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/units-of-measure https://learn.microsoft.com/en-us/dotnet/fsharp/language-ref...
- stiiv 3y agoThank you for not resisting. F# is very hard to beat for a tight domain model.
- openquery 3y agoAnd the equivalent uom in Rust. https://crates.io/crates/uom https://crates.io/crates/uom
- deleted 3y ago[deleted]
- nritchie 3y agoOr unitful.jl in Julia which evaluates the units at compile time resulting in no performance loss at runtime.
- sharkdp 3y agoF# is the only language I looked at that has a really powerful unit system. The author of that unit system wrote his PhD thesis on the subject [1]. Numbat's type system is actually pretty close to what was suggested in that thesis (in contrast to F#'s system, which is based on units — not dimensions). [1] https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-391.pdf https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-391.pdf