chipshort / wasm-float-transpiler

(WIP) Softfloats for WebAssembly
5 stars 0 forks source link

Investigate more possible backends #5

Open chipshort opened 1 year ago

chipshort commented 1 year ago

Here are some more possible backends, I found:

simple-soft-float
rug # uses mpfr under the hood
softfloat-wrapper / softfloat-sys # uses berkeley softfloat under the hood
dashu-float # arbitrary base and has much higher precision than we actually need, so probably not interesting
astro-float # arbitrary precision
https://github.com/huonw/float # haven't checked yet, but is very old and has deprecated dependency
amplify_apfloat # looks like a fork of rustc_apfloat, has more downloads on crates.io

Note on C libraries

rug and softfloat-wrapper would be great candidates if we could get the underlying c libraries to compile on wasm, since they are widely known and battle proven. mpfr might be somewhat problematic for some projects because of GPL, but a note on that somewhere should be fine. I have tried getting a wasm project to compile with them, but had no luck until now.

chipshort commented 1 year ago

I've had some success converting the Berkeley SoftFloat library to Rust using c2rust and a small shell script to clean up, so that's also an option.