Numbat
Languages and libraries
programming language
SHOW HN2023
How HN took it
9 positive, 20 neutral or asking, 0 mixed, 9 critical, out of 38 comments about the project. Thread score +0.04.
Idea: 3 for, 8 againstDesign: 1 for, 1 againstDocs: 1 for, 0 against
The thread, comment by comment
Each row is a top-level comment and its replies, in HN's order. Select a cell to open that comment on HN.
positive neutral or mixed critical about another commenter or something else the maker
What HN said
What people liked
Clear, well-written introduction article
From 1 comment
Still reading the article, and really intrigued by and love this idea. But can I just say that I find this intro extremely well written. I feel like the writer is reading my…
SuperNinKenDo on HN
Type-checked units are a useful idea
From 2 comments
This is great. I want this as an addon to JS and Python.
Aspos on HNSuper cool! I love when programming languages try to do more with types. Julia has a neat little library called Unitful.jl[1] which does almost exactly what Numbat does by taking…
cosmojg on HN
Objections
Month and year units are averaged constants, which can mislead
From 3 comments
A month cannot be unambiguously represented as a length of time, as the length of a month is variable.
wwalexander on HNImpressive! One thing I find unintuitive is the implementation of variable length units (like months or years) as an averaged constant. Then again, perhaps that’s the point - and…
merelysounds on HNHow does something like `let y: Time = 1 year` work? Does it take into consideration the idea of leap years and leap seconds, counting a single year as 365.2422 days[0]? Or does…
manifoldgeo on HN
Linear algebra with mixed units is not handled yet
From 2 comments
the classic problem for such number systems is linear algebra https://yosefk.com/blog/can-your-static-type-system-handle-linear-algebra.html the issue is that each column and…
kragen on HNmost linear algebra requires vectors of multiple unit types. think of runge-kutta for a second-order system, for example, or just about any multivariate system. see…
kragen on HN
Requests
Aggregate types such as vectors and matrices
From 1 comment
the classic problem for such number systems is linear algebra https://yosefk.com/blog/can-your-static-type-system-handle-linear-algebra.html the issue is that each column and…
kragen on HN
Date arithmetic relative to today
From 1 comment
Can it be used as a date calculator? I didn't see a way to specify "today" or "tomorrow". Like "today" + 14 days etc.
indentit on HN
Questions
How are calendar and sidereal time units distinguished
From 2 comments
I feel like that’s unit confusion. Converting from year to day should require you to specify what calendar year you’re in to resolve the ambiguity. Otherwise I set an alarm for…
vlovich123 on HNOk so I did some reading and I like what I see, its important however to properly disambiguate between the two kinds of time units. Chronological Time units and Calendrical Time…
techdragon on HN
How are transcendental functions typed
From 2 comments
How does Numbat infer the type/unit for operations that involve transcendental functions like the trigonometric functions and the natural logarithm? How about for exponents that…
jskherman on HNYou don't have to convert to scalars. Numbers have a type of 1 (= Scalar). You can just call exp(3), for example: https://numbat.dev/?q=exp%283%29%E2%8F%8E Or you could pass an…
sharkdp on HN
Alternatives named
Frink
From 2 comments
If I’m reading this correctly, the Frink language has similar features (and also seems darn useful!) https://frinklang.org/
joeatwork on HNFrink (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…
thesuperbigfrog on HN
Unitful.jl
From 1 comment
Super cool! I love when programming languages try to do more with types. Julia has a neat little library called Unitful.jl[1] which does almost exactly what Numbat does by taking…
cosmojg on HN
F# Units of Measure
From 1 comment
I can't resist mentioning F# Units of Measure aka UoM :) https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/units-of-measure
evntdrvn on HN
GNU Units
From 1 comment
Remind me of GNU Units https://www.gnu.org/software/units/
hsfzxjy on HN
Unchained (Nim)
From 1 comment
Or 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…
V1ndaar on HN