You don't need a new programming language for something that C++ templates with integer constants give you for free.
Can you provide examples?
Show HN: Numbat – A programming language with physical dimensions as types
41–50 of 122 posts
Re: Show HN: Numbat – A programming language with physical dimensions as types
#42Re: Show HN: Numbat – A programming language with physical dimensions as types
#43You don't need a new programming language for something that C++ templates with integer constants give you for free.
If rust ever gets more complete const generics, then things like tiny-uom might work.
Re: Show HN: Numbat – A programming language with physical dimensions as types
#44Re: Show HN: Numbat – A programming language with physical dimensions as types
#45Frink runs on the JVM and is also available on Android.
I use it as a general purpose calculator on my smartphone.
It's really nice that Numbat is written in Rust :) Will have to try it out.
Re: Show HN: Numbat – A programming language with physical dimensions as types
#46I 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 dimensions as types
#47If the author is around, I notice in the README you mention the GNU units program, which I use quite a bit. I'm curious if you've made any notable divergences from it?
Re: Show HN: Numbat – A programming language with physical dimensions as types
#48Frink ( https://frinklang.org/ ) is an older language with similar design goals. Frink runs on the JVM and is also available on Android. I use it as a general purpose calculator on my smartphone. It's really nice that Numbat is written in Rust :) Will have to try it out.
Re: Show HN: Numbat – A programming language with physical dimensions as types
#49the issue is that each column and each row of a matrix can have different units. worse, gauss-jordan elimination chooses which rows to operate on dynamically. there is eventually a solution to this problem in c++ far down the comments thread
i don't see anything in https://numbat.dev/doc/type-system.html about aggregate types such as vectors, matrices, maps, arrays, lists, trees, records, etc., though it does have a suggestively named scalar type. i wonder how it handles this sort of thing
Re: Show HN: Numbat – A programming language with physical dimensions as types
#50Or you could just use Nim [0], where this sort of thing can be implemented in Nim's macro system. Then you have a regular programming language combined with CT safe units. :) It even pretty much looks identical to those Numbat snippets! import unchained let earth_mass = 5.972168e24.kg let solar_mass = 1.9885e30.kg let lunar_mass = 7.342e22.kg let distance_sun = 1.AU # astronomical unit let distance_moon = 384_400.km…
how does unchained handle gaussian elimination