-
Notifications
You must be signed in to change notification settings - Fork 468
Improved 64 bit addition #139
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
Conversation
thanks! are you familiar with nodejs?
|
({lo = other_low_; hi = other_high_} : t) = | ||
let low = logand (add this_low_ other_low_) 0xFFFFFFFFn in | ||
let overflow = if other_low_ < 1n | ||
then sub Nativeint.min_int other_low_ < this_low_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's your expected min_int
and max_int
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They should be -0x80000000
and 0x7fffffff
. It's probably not correct for bucklescript's Nativeint
(depending on how we implement it).
Running
|
you also need
you can hard code |
Still having some issues:
|
Hi I made a fresh copy of your repo and it works for me, looking at the error messages, did you relocate your patched compiler later?
|
btw, after I replaced mocha test/*test.js
192 passing (350ms) It looks good |
btw, another interesting encoding is |
That'd be great, especially if it could be applied to all records containing only ints (char and int32 fit too).
Yep, that was it. I can run the tests now. However, they fail for me. Actually there seems to be a bug in the overflow check. I'll try to fix it. |
Should be good now |
Cool, for your info, I used watchman to build those ml files automatically, (see build.json) watchman -j < build.json # every time you change ml files regen js file
mocha -w -R list test/*test.js # watch mode for mocha, every time js files changed re-run the test I will check with our legal department before merging your changes, it should not take that long, thanks for contribution ! |
For your info, I fixed a bug in the compiler so that I also added functionality of int64 mul (it's pretty naive, literally translated from google closure library) |
@copy Just let you know that @kpfleming is working on the contribution page, we appreciate your work and will merge it once we have a contribution guide line, thanks again. |
hi @copy, we have a file about how to contribute(https://github.com/bloomberg/bucklescript/blob/master/CONTRIBUTING.md), would you rebase your change when you have time? thanks |
…rescript-lang#139) * implement syntax for arity zero vs arity one in uncurried application Since there is no syntax space for arity zero vs arity one, we parse `fn(. ())` into `fn(. {let __res_unit = (); __res_unit})` when the parsetree is intended for type checking `fn(.)` is treated as zero arity application * add CHANGELOG entry
I added some tests, how can I run them?