Coder Social home page Coder Social logo

Comments (3)

titzer avatar titzer commented on May 29, 2024

There are at least three issues. 1.) Subtyping for validating value types, 2.) runtime type information for functions, and 3.) dynamic checks for indirect calls through tables.

  1. I am not sure if there is something specific to func.bind, but there are currently test cases (e.g. https://github.com/WebAssembly/function-references/blob/master/test/core/func_bind.wast#L365) that enforce no subtyping between function references. I think this should be allowed. I've implemented the general thing, so I am failing tests now :(

  2. Runtime type information?

  3. Subtype checks for functions are expensive. Identity checks seem overly restrictive. (They also have their own issues--V8 does this with local canonicalization of signature ids and local views on tables, which allows separate compilation with no memory leaks, but makes table updates relatively expensive).

from function-references.

rossberg avatar rossberg commented on May 29, 2024

@titzer, note the discussion of function subtyping in the overview. I don't think we can afford to relax the existing call_indirect to allow subtyping, because that would cause a performance regression. Consequently, if we want function subtyping, we have to distinguish subtypable and non-subtypable function types (see the link).

We could then add a second form of call_indirect that operates up to subtyping, but I wonder what the use case would be, given that call_indirect is mostly wanted for compiling C/Rust, and other uses will probably prefer call_ref (potentially paired with casts).

from function-references.

rossberg avatar rossberg commented on May 29, 2024

Subtyping on functions is not included in this proposal.

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.