-
Notifications
You must be signed in to change notification settings - Fork 99
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
Base Library Adjustments for Latest Motoko RTS #589
base: next-moc
Are you sure you want to change the base?
Conversation
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.
FTR there's a crate that supports hex formatting https://crates.io/crates/hexfloat2, but perhaps we can't use it (or don't want to).
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.
I wonder if this PR should actually go into branch next-moc, not master, since that is what we test against in the motoko repo.
After the merge, we'd have to adjust moc's nix/sources.json to reference the commit on next-moc.
When we make a release of base, the changes from next-moc will be merged into master.
Moc's ci actually tests against motoko-base/next-moc. I was confused why this works currently but I guess it's because, prior to this PR, the moc CI would only test the classical version of the compiler, whose behaviour is still unchanged until we dump musl, right?
This looks interesting and also quite small. Certainly worth to try. Will put this on my backlog. Thank you for pointing to this library! |
Thanks for explaining. You are right. I rebased the PR on |
Adjusting the base library for latest Motoko RTS changes:
Changes:
The original Musl float formatter has been replaced by the Rust implementation with some subtle format changes:
NaN
, while the NaN sign bit is omitted.Float.format(#hex)
). This is probably acceptable as it is rarely used.Once we have dfinity/motoko#4677 merged in Motoko
master
, then we can remove the backwards compatibility of float formatting in these tests. Backwards compatibility is here needed to makemotoko-base
tests pass with the old Motoko compiler version.