Wish I had this in engineering undergrad! Very cool.
Introducing Numbat: A programming language with physical units as types
Submitted 1 year ago by bugsmith@programming.dev to programming@programming.dev
https://numbat.dev/articles/intro.html
Comments
vhstape@lemmy.sdf.org 1 year ago
Nawor3565@lemmy.blahaj.zone 1 year ago
I’m currently in engineering undergrad and this looks like it’ll be a lifesaver. Wolfram Alpha can do some pretty good work with units sometimes. But a lot of the time it’ll do weird stuff like refuse to interpret “V” as “volt”, so you have to type out the full name of every single unit. This language should handle that a million times better.
solrize@lemmy.world 1 year ago
I’ve always thought Frink (frinklang.org) looked pretty cool. It’s been around forever. I’ve never used it though.
lupec@lemm.ee 1 year ago
Fascinating idea, that was an interesting read! Don’t think I’d ever seen something like that done before.
OmnipotentEntity@beehaw.org 1 year ago
This is a cool idea. There are other programming languages that have libraries that expose similar behavior. For instance, Rust has the uom crate, Haskell has the units package, and C++ has the header only library SI.
But there is something to be said about it being built in.
aluminium@lemmy.world 1 year ago
There exist a bunch of libraries designed for kotlin using its extension methods and properties system to produce the same, like this one : github.com/vsirotin/si-units
tiny_electron@beehaw.org 1 year ago
I would have loved to use that when I was studying physics
silas@programming.dev 1 year ago
stilgar@infosec.pub 1 year ago
This looks like a lot of fun to use, I loved the example from What If, so many units!
monotremata@kbin.social 1 year ago
I do a lot of this stuff with the HP48 Units menu (albeit at this point via an emulator on my phone).
Bluetreefrog@lemmy.world 1 year ago
Reminds me of Mathcad and Calca
kibiz0r@lemmy.world 1 year ago
F# has a feature kinda like this: learn.microsoft.com/en-us/…/units-of-measure
aluminium@lemmy.world 1 year ago
Thought the same, plus you have the massive .NET Ecosystem.