Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
i64 to BigInt in JS #1172
Currently I64 can't pass the boundaries of WebAssembly, it will throw an exception from the
Today V8 announced the support for the BigInt proposal (still stage 3 at the moment), we can expect to see more and more adoption soon.
My idea is:
This introduces an inconsistent behavior on some hosts, but avoiding that would lock down i64 in JS for a very long time.
What do you think?
Yes, that's my idea.
Since we don't have a wide adoption for BigInt anyway, the use case might be to restricted at the moment.
But to make it portable we would have a mechanism to allow the user to fallback to something else, otherwise he will probably implement his own mechanism. It will be then very difficult for WebAssembly to introduce a breaking change.
One possibility would be to prepare the WebAssembly/BigInt interaction so that it's possible for browsers to ship the WebAssembly BigInt integration at the same time as they ship BigInt itself. I could write a specification for this. I'm not sure if we should throw an exception or not for out-of-bounds BigInts; maybe we should be consistent with TypedArrays (which would not throw).