Hacker News new | ask | show | jobs
by evntdrvn 948 days ago
I can't resist mentioning F# Units of Measure aka UoM :)

https://learn.microsoft.com/en-us/dotnet/fsharp/language-ref...

4 comments

F# 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

Or unitful.jl in Julia which evaluates the units at compile time resulting in no performance loss at runtime.
And the equivalent uom in Rust.

https://crates.io/crates/uom

Thank you for not resisting. F# is very hard to beat for a tight domain model.