Git Product home page Git Product logo

Comments (4)

rossberg avatar rossberg commented on June 24, 2024

The current design is intentional. I think it is crucial to avoid making the basic interface higher-order, since that would be very inconvenient to map to plain C and even harder (and likely more costly) to access from FFI bindings.

The interface you propose can be implemented very easily on top of what's currently provided, but not vice versa.

(Also, there are valid use cases where it is simpler to treat imports/exports positionally and not having to care about their names at all, see e.g. the examples. Basically, whenever you are in control of the binary.)

from wasm-c-api.

titzer avatar titzer commented on June 24, 2024

The problem is that positional correspondence does not provide the embedder enough information to resolve imports at all, except by convention or out-of-band information such as parsing the imports itself. Names, kinds, and signatures are the language of imports, so a complete API needs to expose them.

(And about layering, you actually cannot implement named import resolution on top of positional correspondence without out-of-band information, whereas the opposite is easy if the contract is to request imports through the programmatic interface in import order).

from wasm-c-api.

titzer avatar titzer commented on June 24, 2024

Actually, sorry. Now that I look at it, I guess it is possible to extract the imports from the module itself and then do the lookups programmaticallly.

from wasm-c-api.

rossberg avatar rossberg commented on June 24, 2024

Yes, that was the idea.

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.