FYI: Saw that there was a discussion tab and started a discussion there as I wasn't sure if it qualifies as an issue
Hi,
I'm writing a WebAssembly Manipulation Library for the Component Model in Rust called Orca.
Not sure if this qualifies as an issue but I'm converting the ComponentTypeSection from the wasmparser to the wasm_encoder and had a few questions.
To convert wasmparser::HeapType::Concrete to wasm_encoder::HeapType which is necessary for ComponentType::Resource, how do the indices map? I see that wasm_encoder::HeapType::Concrete takes a u32 index but in wasm_encoder::HeapType::Concrete it is an UnpackedIndex where each variant represents a index into a particular type space or elements. For now I've directly converted them here.
To convert ComponentType::Func from wasmparser to wasm_encoder, we need to convert wasmparser::ComponentFuncResult using the wasm_encoder::ComponentFuncTypeEncoder, where we need to convert both the named and unnamed types. The FuncTypeEncoder's results method expects (&str, ComponentValType) but ComponentFuncResult::Unnamed does not have a &str field. In this case would passing an empty string suffice for the encoder?
FYI: Saw that there was a discussion tab and started a discussion there as I wasn't sure if it qualifies as an issue
Hi,
I'm writing a WebAssembly Manipulation Library for the Component Model in Rust called Orca.
Not sure if this qualifies as an issue but I'm converting the
ComponentTypeSection
from thewasmparser
to thewasm_encoder
and had a few questions.wasmparser::HeapType::Concrete
towasm_encoder::HeapType
which is necessary forComponentType::Resource
, how do the indices map? I see that wasm_encoder::HeapType::Concrete takes au32
index but in wasm_encoder::HeapType::Concrete it is an UnpackedIndex where each variant represents a index into a particular type space or elements. For now I've directly converted them here.ComponentType::Func
fromwasmparser
towasm_encoder
, we need to convert wasmparser::ComponentFuncResult using the wasm_encoder::ComponentFuncTypeEncoder, where we need to convert both the named and unnamed types. The FuncTypeEncoder'sresults
method expects(&str, ComponentValType)
butComponentFuncResult::Unnamed
does not have a&str
field. In this case would passing an empty string suffice for the encoder?