-
Notifications
You must be signed in to change notification settings - Fork 98
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
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: * Also test enhanced orthogonal persistence with Wasm Memory 64. * Be prepared for the RTS dependency upgrade dfinity/motoko#4677 Changes: The original Musl float formatter has been replaced by the Rust implementation with some subtle format changes: - Numbers are displayed with the actually defined precision, no longer truncating trailing zeros and potentially revealing existing numeric errors. - The exponent is printed with an explicit sign and multiple digits. - NaN is formatted differently, now `NaN`, while the NaN sign bit is omitted. - The hexadecimal float formatter is no longer supported (`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 make `motoko-base` tests pass with the old Motoko compiler version. --------- Co-authored-by: Claudio Russo <claudio@dfinity.org>
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.