News for hackers. Stuff that matters.
Re:Twenty five thousand dollars of funny money by raydiatian on Saturday December 03, 2022 @01:21PM (#33845852)
Critical things come with critical stickers:

Transformer boxes, Nuclear waste, Highly acidic compounds, High energy lasers, choking hazards.

The oldest debate: should there be a money primitive in the type system?

I mean, availability breeds use, use breeds awareness, awareness breeds or enforces proper use. A currency/money type would be a pretty clear label to ward off a whole suite of stupid bugs like the one described in this post.

Re:Twenty five thousand dollars of funny money by mxz3000 on Saturday December 03, 2022 @01:32PM (#33845965)
or just units of measure a more general solution than what you're suggesting, implemented by languages like F#

https://learn.microsoft.com/en-us/dotnet/fsharp/language-ref...

Re:Twenty five thousand dollars of funny money by raydiatian on Saturday December 03, 2022 @02:34PM (#33846500)
Wow that is a cool feature, thanks for sharing.

I think there are some other things like fixed-point rather than floating-point decimals for storing/manipulating currency. IIRC, the number 0.1 cannot be precisely represented with floating point system, but that just may be an old wives tale at this point.