TimelyDataflow / abomonation

A mortifying serialization library for Rust
MIT License
317 stars 30 forks source link

No std #40

Open hunhoffe opened 2 years ago

hunhoffe commented 2 years ago

Hello! I've created a no-std version of abomonation by using core2::io::Write and core2::io::Result from the core2 crate.

I am fairly new to rust and I am happy to rework my changes if there are any stylistic or other issues with the current implementation. I have not looked into creating a no-std version of the abomonation_derive crate at this time. Because of this, I removed the deprecation warning from unsafe_abomonate since I wasn't sure if I could make the deprecation warning feature dependent (e.g., warn for std, do not warn for no-std). I welcome suggestions for how to handle this more gracefully.

frankmcsherry commented 2 years ago

Hi, I'm sorry for the delayed response.

The crate is .. in something of a holding pattern as Rust sorts out its undefined behavior definitions. It's almost certainly undefined at the moment, but afaict not easily fixed until Rust commits to some specific behavior ("fixed" could be either "deleted" or something better).

As such, I'm recommending folks who want to use it with modification fork it and make the modifications, as part of owning the uncertainty around UB. Happy to keep the PR open for the possibility of better days, but not eager to encourage investment when we don't know if it is EOLed. Sorry!

hunhoffe commented 2 years ago

No problem! Thanks for the response, and I understand. I couldn't wait until Rust settles on undefined behavior patterns, and so I'd be happy if the PR could stick around so if other folks also can't wait they can have access to an interim solution.