Stream: git-wasmtime

Topic: wasmtime / PR #8476 Switch from `bincode` to `postcard` f...


view this post on Zulip Wasmtime GitHub notifications bot (Apr 25 2024 at 19:42):

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). The bincode crate on crates.io doesn't work on no_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 with no_std. After auditing the crate this commit then switches out Wasmtime's usage of bincode for postcard throughout the repository.

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Apr 25 2024 at 19:42):

alexcrichton requested wasmtime-compiler-reviewers for a review on PR #8476.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 25 2024 at 19:42):

alexcrichton requested cfallin for a review on PR #8476.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 25 2024 at 19:42):

alexcrichton requested fitzgen for a review on PR #8476.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 25 2024 at 19:42):

alexcrichton requested wasmtime-core-reviewers for a review on PR #8476.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 25 2024 at 19:42):

alexcrichton requested wasmtime-default-reviewers for a review on PR #8476.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 25 2024 at 20:43):

fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 25 2024 at 21:06):

fitzgen merged PR #8476.


Last updated: Oct 23 2024 at 20:03 UTC