alexcrichton opened PR #8476 from alexcrichton:bincode-to-postcard
to bytecodealliance:main
:
Wasmtime and Cranelift have a few miscellaenous use cases for "just take this Rust type and make it bytes", for example Wasmtime's serialization of internal metadata into a compiled module. Previously Wasmtime used the
bincode
crate for performing these tasks as the format was generally optimized to be small and fast, not general purpose (e.g. JSON). Thebincode
crate on crates.io doesn't work onno_std
, however, and with the work in #8341 that's an issue now for Wasmtime.This crate switches instead to the
postcard
crate. This crate is listed in Serde's documentation as:Postcard, a no_std and embedded-systems friendly compact binary
format.While I've not personally used it before it checks all the boxes we relied on
bincode
for and additionally works withno_std
. After auditing the crate this commit then switches out Wasmtime's usage ofbincode
forpostcard
throughout the repository.<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
alexcrichton requested wasmtime-compiler-reviewers for a review on PR #8476.
alexcrichton requested cfallin for a review on PR #8476.
alexcrichton requested fitzgen for a review on PR #8476.
alexcrichton requested wasmtime-core-reviewers for a review on PR #8476.
alexcrichton requested wasmtime-default-reviewers for a review on PR #8476.
fitzgen submitted PR review.
fitzgen merged PR #8476.
Last updated: Nov 22 2024 at 17:03 UTC