wasm-bindgen
wasm-bindgen copied to clipboard
Feat: Fixed size array support
Wow, that looks surprisingly less complicated then I imagined! Amazing work!
Keep in mind that I'm not entirely sure if or how this will conflict with https://github.com/rustwasm/wasm-bindgen/issues/3454 in the future. But definitely willing to merge this, https://github.com/rustwasm/wasm-bindgen/issues/3454 might be a long way off.
Thanks @daxpedda! The one thing that slightly concerns me is passing the array directly. Technically that wouldn't be FFI safe in C, but it seems to work at least for now. No guarantees that it continues to do so though. I messed around with trying to pass a single raw pointer back and forth (which might actually be more performant if we convert to JS TypedArrays). Might see if I can get that working. Would result in us not needing to make any changes to the xformer I think.
I wouldn't feel comfortable enough reviewing something not FFI safe, so that's definitely preferable.