You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've noticed that while writing bindings or using component model there is a need for the library being consumed to be able to provide exports to the host, some examples include:
cabi_realloc - In the component model
grainboy - In grainboy we have to re-export functions for the event loop.
We should look into how we could improve this experience Ideally it would be nice if the consumer of the module could just include it without having to be aware of the low level things going on or the host exports, this poses some questions and challenges though such as what if you are using two libraries with the same exports, how can the user still maintain control over this. I think the most simple approach would be to re-export the functions and then have things closer to the main file in the dependency tree override if they share the same name, I don't think this approach would be ideal however as it does not handle every situation and offers little control and transparency. Maybe we could look into a way of having modules register foreign exports and then there needs to be some sort of acknowledgment of this on the include, I don't think either of these examples are great however so I think alternative ideas would be great to hear and maybe we can find something that would make sense in the language, whenever we get silo having a silo.toml file might provide a good place to handle this.
The text was updated successfully, but these errors were encountered:
I've noticed that while writing bindings or using component model there is a need for the library being consumed to be able to provide exports to the host, some examples include:
cabi_realloc
- In the component modelgrainboy
- In grainboy we have to re-export functions for the event loop.We should look into how we could improve this experience Ideally it would be nice if the consumer of the module could just include it without having to be aware of the low level things going on or the host exports, this poses some questions and challenges though such as what if you are using two libraries with the same exports, how can the user still maintain control over this. I think the most simple approach would be to re-export the functions and then have things closer to the main file in the dependency tree override if they share the same name, I don't think this approach would be ideal however as it does not handle every situation and offers little control and transparency. Maybe we could look into a way of having modules register foreign exports and then there needs to be some sort of acknowledgment of this on the include, I don't think either of these examples are great however so I think alternative ideas would be great to hear and maybe we can find something that would make sense in the language, whenever we get silo having a
silo.toml
file might provide a good place to handle this.The text was updated successfully, but these errors were encountered: