Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS BigInt for Ints? #2853

Closed
Rudxain opened this issue Mar 27, 2024 · 5 comments
Closed

JS BigInt for Ints? #2853

Rudxain opened this issue Mar 27, 2024 · 5 comments

Comments

@Rudxain
Copy link

Rudxain commented Mar 27, 2024

Why doesn't the JavaScript transpiler use BigInt "under-the-hood" to store Ints?

@lpil
Copy link
Member

lpil commented Mar 27, 2024

Because they are very slow and break interop.

@lpil lpil closed this as not planned Won't fix, can't repro, duplicate, stale Mar 27, 2024
@Rudxain
Copy link
Author

Rudxain commented Mar 28, 2024

break interop.

Do you mean they aren't backwards-compatible? They're from ES2020. Does the JS need to be IE11-compatible?

@inoas
Copy link
Contributor

inoas commented Mar 28, 2024

break interop.

Do you mean they aren't backwards-compatible? They're from ES2020. Does the JS need to be IE11-compatible?

They are (usually) not compatible with JSON afair.

@inoas
Copy link
Contributor

inoas commented Mar 28, 2024

They are also very slow on JS for common int operations, AFAIK. So they are not a good default until you need very large ints. There is https://hex.pm/packages/bigi for that.

@Rudxain
Copy link
Author

Rudxain commented Apr 2, 2024

oh ok, thanks for explaining 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants