WebAssembly / component-model

Repository for design and specification of the Component Model
Other
897 stars 75 forks source link

`overload` convention #358

Open oovm opened 1 month ago

oovm commented 1 month ago

Currently, each function has a different name.

Can we add #overload(target_name) to require languages that support overloading to generate an overloaded version of the function?

Different languages have different overload resolutions, so the selected function instances will be different.

This is an unsafe ffi operation, so it is just a overload suggestion.

The overload version is generated based on the original version.

In case of error resolution, the user can manually call the function of the original version.

lukewagner commented 1 month ago

That's a good question, and it's something we're also discussing in #331, based on a slightly different use case. My current best working theory is in this comment.