-
Notifications
You must be signed in to change notification settings - Fork 558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support no_std #362
Comments
It now has a `std` features, and uses `#![no_std]` otherwise. cc serde-rs#362
It now has a `std` feature, and uses `#![no_std]` otherwise. cc serde-rs#362
FWIW, this morning I wrote a serde-json-core crate that provides JSON (de)serialization on no_std. It's certainly not on par with the real serde-json as I don't plan to add any stuff that requires dynamic memory allocation to it, or add support for floats. I also made some adjustments to avoid having the binary size of my firmware increase by several KBs. Anyway, you can check the documentation for details about what works and what doesn't work. Also, I don't plan to send a PR to serde-json as I doubt all my changes are going to be welcomed, but anyone else is free to try. |
Nice! I am happy to have @japaric own a separate no_std JSON library. The API is sufficiently different that I think both std and no_std users will be better served if we keep these as separate libraries. I have retagged this issue as a docs issue to drop a link to serde-json-core in our readme and rustdoc. |
I added a link to serde-json-core in our readme and rustdoc, as well as https://serde.rs/no-std.html. Thanks! |
Reopening because there continues not to be a no_std JSON crate that can support types from |
I gave this a shot for fishinabarrel/linux-kernel-module-rust because we support allocation just fine, and serde-json-core doesn't support either dynamic types (like serializing/deserializing a Unfortunately it looks like the bulk of src/ser.rs is implemented via the A couple of options that occur to me:
I'm leaning towards the last option n fishinabarrel/linux-kernel-module-rust#121, but that's pretty involved.... but if other people are interested in that approach, then it would make more sense to go down that road. (Also, because of issues with build-dependencies and no-std described in that ticket, we probably couldn't use serde-json even if there were a working no-std version, until that Cargo bug gets fixed too.) |
This should be addressed by #606 now (I'm sorry, I forgot to add a relevant |
Wow, thank you @Xanewok! I'm excited to try it out! |
We have been putting this off because nobody has needed it so far.
But in dtolnay/dtoa#8:
The text was updated successfully, but these errors were encountered: