gimli-rs / leb128

Read and write DWARF's "Little Endian Base 128" variable length integer encoding
http://gimli-rs.github.io/leb128/leb128/index.html
Apache License 2.0
18 stars 15 forks source link

no_std support #25

Open orsinium opened 1 month ago

orsinium commented 1 month ago

Thank you for the project! We're looking into using wasm-coredump in wasmi for generating coredumps. The problem is that wasmi is designed for no_std environments and wasm-coredump depends on leb128 which requires std. Would you be interested in leb128 having no_std support?

Making leb128 no_std is quite easy. The only problem is that there is no io::Read and io::Write in core yet. The solution is to use embedded-io which provides no_std io traits and can also automatically convert everything implementing std::io traits. Would you be ok with leb128 having a dependency on embedded-io?

fitzgen commented 3 weeks ago

Would you be ok with leb128 having a dependency on embedded-io?

I think this is fine, if we do the following approach

fitzgen commented 3 weeks ago

This way, std usage doesn't need embedded-io