Ask HN: Why are many Web Frameworks using BigInt?

1 points by webmobdev ↗ HN
Pale Moon v32.4.0 release note - https://www.palemoon.org/releasenotes.shtml - has the following interesting tidbit:

The BigInt primitive (base number format) in JavaScript allows JavaScript to handle excessively large integers (whole numbers). This primitive is especially useful for specialized scientific applications that need very large yet accurate numbers, but has seen widespread adoption for an as of yet unknown reason as part of web frameworks, causing general web compatibility issues for Pale Moon when scripts expect BigInt support and instead have an error thrown. We have now implemented this primitive for use so we no longer have compatibility issues with these frameworks. It is still unknown why BigInt is in use there and for what. Critical note: BigInt might be tempting to consider for JS-backed cryptography but this is very ill-advised, as BigInt operations are, by their nature, not constant-time and allow timing and side-channel attacks.

Does anybody have any idea why so many web frameworks are using BigInt?

6 comments

[ 2.8 ms ] story [ 58.7 ms ] thread
What web frameworks, and what do you mean by "so many"?

Just checked - React, Angular, Vue.js and Svelte don't use it.

I'm not sure what kind of web frameworks they have in mind, but "specialized scientific applications" is not the only reason for it -- BigInt is the only way to get standard 64-bit numbers (uint64/int64) in JavaScript without emulating them, since JS number type, aka 64-bit floating point, is limited to 53-bit integers. There are also Big[U]int64Array container types to load/store 64-bit arrays of integers from ArrayBuffer.
Ok, but what other use cases are there for using this datatype? (Particularly in a web framework).
Can you show an example of a web framework using BigInt? I went looking and didn't find any.

Angular has a single instance of it in the client code where they do a SHA1 digest. That's it.

I honestly wasn't even aware this was an issue. But someone who works with browsers would obviously encounter such issue that they have to address, and that's why I quoted the specific excerpt from Pale Moon release notes. A search for "BigInt" in their forum does display a lot of complains about it - https://forum.palemoon.org/search.php?keywords=bigint ... Angular is mentioned (and it is popular) but it could be that the release notes may not be talking about the popular frameworks but just generic "web framework" in general.
It don't know why it would be "an issue" — it's a part of the ECMAScript standard. Do they only implement new language features when something breaks and then wonder in release notes why somebody would use these features? Seems like not a good way to develop a modern browser.