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

Think about passing I64s to/from WASM as BigInts #117

Closed
dcodeIO opened this issue May 22, 2018 · 4 comments
Closed

Think about passing I64s to/from WASM as BigInts #117

dcodeIO opened this issue May 22, 2018 · 4 comments

Comments

@dcodeIO
Copy link
Member

dcodeIO commented May 22, 2018

As of #111 it appears that I64s will be able to cross the WASM<->JS boundary at some point as BigInts, thus enabling support for long integers in both the assembly and portable as well as generated typescript definitions. One not so obvious prequesite here might be to handle these in (i64-to-i32-lowering) asm.js output as well somehow.

@MicahZoltu
Copy link

BigInt is now in Chrome, Firefox (behind experimental flag), and NodeJS.

@singpolyma-shopify
Copy link
Contributor

Would love to see 1234n syntax and BigInt type supported in assemblyscript, even if it's just i64 under the hood for now.

@MaxGraey
Copy link
Member

MaxGraey commented May 24, 2019

BigInt is definitely make sense only for arbitrary precision (actually any large numbers). In other case it will confuse folks

@dcodeIO
Copy link
Member Author

dcodeIO commented Sep 15, 2019

The loader now has BigInt64Array etc. support for what is an Int64Array in AS, and passing i64 <-> BigInt via exports and imports can be achieved by enabling --experimental-wasm-bigint in V8 for example with no further work necessary on our end. As such I consider "passing I64 to/from WASM" resolved, even though we don't have a BigInt class on the AS side yet, which would be a different enhancement to make.

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

No branches or pull requests

4 participants