Hi, I'm working on component model on WasmEdge. I notice in the definition section, there is a core func <id>?
(canon resource.new <typeidx> (core func <id>?))
but in binary section, there is only a type index
| 0x02 rt:<typeidx> => (canon resource.new rt (core func))
where can I found the core function when loading the binary? Also for any similar cases.
The (core func <id>?)
is indicating that a core function is created with the canon resource.new
intrinsic, and the name of that function is <id>
(it's optional), those parts aren't in the binary format
I see, so does runtime must know how to provide new
/drop
etc functions for any type? Since some of types are hard to imagine a common zero constructor, e.g. function.
<typeidx>
in this case must be a resource, but yes runtimes must be able to create a new instance of this resource type. Note though that this intrinsic is only valid of <typeidx>
was a resource defined in the current component, so it's probably not quite as free-form as you're thinking
I see, thanks you!
Last updated: Nov 25 2024 at 19:03 UTC