4 ms·
There is a decimal proposal for JS. It almost certainly won't use normal operators though because of the JIT implementor complaints about adding BigInt (not to
by hajile 2y ago
There is a decimal proposal for JS. It almost certainly won't use normal operators though because of the JIT implementor complaints about adding BigInt (not to mention recently dropping the record/tuple proposal over `===`).
https://github.com/tc39/proposal-decimal https://github.com/tc39/proposal-decimal
- wruza 2y agoThen it's of little use imo. Library decimals already exist in multiple optimized forms.
- hajile 2y agoIt would still use faster JIT mechanisms internally and make strong guarantees, but the interface would suck. JS really needs to add a "use type" or typed module feature with strong Hindley-Milner types. This would allow them to cut the rest of the really bad parts like the bad type coercion, but definite types would also mean that adding these new features to typed modules only would get rid of the performance issues for stuff like operator overloading because the types would be known in advance.