bytecodealliance / bytecodealliance/wit-bindgen

Optimize the size of generated bindings

Open
#1,604 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
1.5k
Forks
286
Avg merge
6h 32m
Merged PRs (30d)
19

Description

The wasip2 crate is 1.3MB and the wasip3 crate is 1.6MB with both crates containing generated bindings that are well over 10k lines of code. There is a lot of redundancy in those bindings. For example casting a u8 to an i32 and back to a u8. Or assigning a trivial constant to a variable and then immediately after that doing Ok(e) or Err(e) rather than inlining the constant or block into the Ok or Err. And the .handle() methods return u32, which then gets passed to an extern function accepting i32 requiring a cast rather than directly using u32 as argument type for the extern function.

Originally posted as https://github.com/bytecodealliance/wasi-rs/issues/156.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.