Coder Social home page Coder Social logo

Comments (6)

rossberg avatar rossberg commented on May 30, 2024

That's a validation error.

from function-references.

Horcrux7 avatar Horcrux7 commented on May 30, 2024

How can an validation error occur if there are no runtime checks?

from function-references.

rossberg avatar rossberg commented on May 30, 2024

I'm afraid I don't understand the question. Validation happens before compilation and execution.

from function-references.

Horcrux7 avatar Horcrux7 commented on May 30, 2024

How should validation occur before compilation? Can be that I does not have understand the concept.

My understand is:

  • I can pass a variable of func.ref to any location.
  • At runtime there can be in a func.ref variable a pointer to any function.
  • The call_ref instruction hat no type information like call_indrect.
  • At compile time, there is no knowledge of the number and type of function parameters.
  • At compile time, there is no knowledge of the number and type of return values.

Of course, the Wasm file compiler has the necessary knowledge about the parameter types. But this not help the Wasm engine.

from function-references.

rossberg avatar rossberg commented on May 30, 2024

Please see the Summary and following sections in the Overview doc. The central novelty in this proposal is the introduction of typed references (ref $ty), which provide the validator with the necessary type information. The func.ref instruction creates such a typed function reference and the call_ref instruction can only be applied to such references (thus the name of the proposal).

from function-references.

Horcrux7 avatar Horcrux7 commented on May 30, 2024

Ok, thank you. This important point I have oversee. Now all is clearer.

from function-references.

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.