Git Product home page Git Product logo

Comments (2)

rossberg avatar rossberg commented on September 25, 2024

The current design is very intentional. Wasm doesn't specify what import resolution means, and hosts may use arbitrary strategies like e.g. materialising modules/functions based on import names or type information. In general, that would require a callback-based mechanism (cf. #53), which in turn is difficult to handle, especially for foreign language bindings.

So the idea of the current design is that the embedder does the resolution outside in whatever way it sees fit and simply constructs an adequate vector for instantiation. That way the issue of import resolution is nicely decoupled while remaining fully general. Custom resolution abstractions can easily be built on top.

from wasm-c-api.

AndrewScheidecker avatar AndrewScheidecker commented on September 25, 2024

So the idea of the current design is that the embedder does the resolution outside in whatever way it sees fit and simply constructs an adequate vector for instantiation.

Yes, I was only proposing to change the import binding to be by name instead of by index. However, I see that multiple imports may have the same module+name, so that wouldn't work.

The problem for WAVM is that it doesn't keep track of import indices in memory: it splits the imports into an array for each kind. I suppose I need to add a map from import index to kind-specific index.

from wasm-c-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.