Wish I had this in engineering undergrad! Very cool.
Introducing Numbat: A programming language with physical units as types
Submitted 11 months ago by bugsmith@programming.dev to programming@programming.dev
https://numbat.dev/articles/intro.html
Comments
vhstape@lemmy.sdf.org 11 months ago
Nawor3565@lemmy.blahaj.zone 11 months 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 11 months 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 11 months ago
Fascinating idea, that was an interesting read! Don’t think I’d ever seen something like that done before.
OmnipotentEntity@beehaw.org 11 months 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 11 months 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 11 months ago
I would have loved to use that when I was studying physics
silas@programming.dev 11 months ago
stilgar@infosec.pub 11 months ago
This looks like a lot of fun to use, I loved the example from What If, so many units!
monotremata@kbin.social 11 months 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 11 months ago
Reminds me of Mathcad and Calca
kibiz0r@lemmy.world 11 months ago
F# has a feature kinda like this: learn.microsoft.com/en-us/…/units-of-measure
aluminium@lemmy.world 11 months ago
Thought the same, plus you have the massive .NET Ecosystem.