bytecodealliance/wat

Use a Rust-based hex float parser

Closed this issue · 4 comments

Hex float parsing is delegated to the C standard library right now but this exposes us to platform differences (like failing tests only on macOS). We should reimplement this in Rust. Crates like https://crates.io/crates/hexf-parse seem promising but don't work immediately. Needs more investigation.

Right now we use strtod and strtof, which I thought wabt used as well, but turns out they have their own hex float parser. Perhaps this can translate that!

Looks like strtod and strtof are way off on MinGW as well, so yet another reason to use one canonical version instead of whatever the system happens to have.

In case it helps, mozilla-central has another one.

Thanks for the link @sunfishcode!

I was able to muster up enough energy and the was digestable enough this it ended up working!