bugsmith@programming.dev to Programming@programming.dev · 10 months agoIntroducing Numbat: A programming language with physical units as typesnumbat.devexternal-linkmessage-square22fedilinkarrow-up1154arrow-down16cross-posted to: programming_languages@programming.devhackernews@lemmy.smeargle.fanshackernews@derp.foo
arrow-up1148arrow-down1external-linkIntroducing Numbat: A programming language with physical units as typesnumbat.devbugsmith@programming.dev to Programming@programming.dev · 10 months agomessage-square22fedilinkcross-posted to: programming_languages@programming.devhackernews@lemmy.smeargle.fanshackernews@derp.foo
minus-squareStarfighter@discuss.tchncs.delinkfedilinkarrow-up3·edit-210 months agoI can’t talk about the other libraries but the uom crate does the same thing. The dimensions are encoded as a vector of generics, allowing you to get the correct unit even when dividing a distance by time for example. It’s quite the clever use of Rusts type system.
I can’t talk about the other libraries but the uom crate does the same thing.
The dimensions are encoded as a vector of generics, allowing you to get the correct unit even when dividing a distance by time for example.
It’s quite the clever use of Rusts type system.