Implement the new canonical ABI
I've started sending PRs to do this, but I figured it'd also be a good thing to write things down:
- [ ] Implement and test NaN canonicalization for float32/float64
- [ ] Make a plan for string encodings -- hardcode to utf-8? option-per-language?
- [ ] Enable mutability in Rust traits generated for in-wasm since recursive entry is now prohibited (#178)
- [ ] Use
post-returninstead of individualfreecalls - [x] Update cases in variants to require their type payload
- [x] Add a
uniontype - [x] Add an
optiontype - [x] Add an
expectedtype - [x] Add an
enumtype - [x] Add a
tupletype - [x] Add a
flagstype - [x] Change return-multiple-values ABI
- [x] Implement MAX_FLAT_PARAMS for passing arguments
- [x] Remove support for old-style
*.witx - [x] Remove support for
char8andusize - [x] Rename
f32andf64tofloat32andfloat64 - [x] Change the
variantABI w.r.t. the "join" function - [x] Split out the
stringtype fromlist<char> - [x] Add a
booltype - [x] Add a
unittype - [x] Remove support for multiple return values
(I'll probably add to this over time as I remember things)
Ok I think all the major pieces that can be done now are largely done. The remaining bits sort of need questions and topics on https://github.com/bytecodealliance/wit-bindgen/issues/214 to be settled first. For example post-return-style things aren't done but functions aren't guaranteed to have a post-return so it doesn't make sense for the host generators to implement something with post-return as-is.
I'm going to close this in favor of https://github.com/bytecodealliance/wit-bindgen/issues/314 since the remaining few items here and there that need to be covered by hosts I think require deeper refactorings to fully address or they're inconsequential to not really matter a whole lot.
@alexcrichton I have a question regarding (since all the 'favored' issues are closed):
Enable mutability in Rust traits generated for in-wasm since recursive entry is now prohibited
wit-bindgen version 0.24.0 still generates x(&self) signature in traits. Is this going to change in the future.
It can theoretically yeah but it would be a bit of a nontrivial lift. I didn't handle that during this whole transition due to the complexity involved, but I forgot to open another tracking issue. If you're up for it would you be ok opening a new issue for it?