cmpute/dashu

Improve support for third-party crates

cmpute opened this issue · 2 comments

  • Support rand for FBig and RBig
  • Support num-traits for FBig and RBig
    • Zero, One, FromPrimitive, ToPrimitive, Num
    • Euclid, Pow
  • Support zeroize for FBig and RBig
  • Support serde for FBig and RBig
    • Support the is_human_readable option (see rust-num/num-rational#90)
    • Serialize to compact binary representation if is_human_readable=false, serialize all to string if is_human_readable=true
    • Improve efficiency of serialized IBig by store the sign bit in the LSB of the highest word (by always shifting the highest word left by 1). This is the zigzag encoding used by postcard.
  • Support rkyv for UBig, IBig, FBig and RBig, try to do zero-copying serialization in this framework.
  • Support arbitrary::Arbitrary or quickcheck::Arbitrary for UBig, IBig, FBig and RBig
  • Support postgres decimal through sqlx, postgres, tokio-postgres or diesel crates (see fraction and rust_decimal crates)
  • Support pyo3 conversion
    • Convert UBig and IBig to native Python int
    • Convert DBig to Python decimal
    • Convert RBig and Relaxed to Python fractions
    • Convert FBig to native python float (double)

Some crates that are related but not yet in the plan to support:

  • rust_decimal
  • half

The support for PyO3 will be postponed, as PyO3 is being actively refactored.