News for hackers. Stuff that matters.
Re:Show HN: Numbat – A programming language with physical di... by evntdrvn on Thursday November 16, 2023 @10:59AM (#38291135)
I can't resist mentioning F# Units of Measure aka UoM :)

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

Re:Show HN: Numbat – A programming language with physical di... by openquery on Thursday November 16, 2023 @11:42AM (#38291767)
And the equivalent uom in Rust.

https://crates.io/crates/uom

Re:Show HN: Numbat – A programming language with physical di... by stiiv on Thursday November 16, 2023 @11:17AM (#38291409)
Thank you for not resisting. F# is very hard to beat for a tight domain model.
Re:Show HN: Numbat – A programming language with physical di... by nritchie on Thursday November 16, 2023 @01:35PM (#38293532)
Or unitful.jl in Julia which evaluates the units at compile time resulting in no performance loss at runtime.
Re:Show HN: Numbat – A programming language with physical di... by sharkdp on Thursday November 16, 2023 @02:39PM (#38294350)
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