-
Notifications
You must be signed in to change notification settings - Fork 693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lambda functions? #774
Comments
Wasm is a code format, so will not support nested functions directly. However, future version are intended to provide support for representing closures one way or the other. |
Lambda functions are generally considered outside the scope of WebAssembly. Languages that compile to WebAssembly (such as C++ and Rust) will support lambdas on WebAssembly in the same manner as they support lambdas for other targets such as x86. The lambda function in the source language will become a separate function in WebAssembly, and state shared from the "parent" to the "child" function is stored in a structure that is passed as an implicit argument to the child function. @rossberg-chromium Do you mean to say that Wasm is planned to get some special support for closures beyond what compilers will do when targeting the MVP? |
As part of far-looking research, we've experimented with some ideas for
adding an object model and typed first-class functions to WASM. One idea we
had was to add a "partial application" operator that would bind some
arguments to a function, similar to what one can do in Scala, but more
general to currying in ML or Haskell. But this is really far out, and for
now we recommend languages compile away their closures.
|
Hello. Will WebAssembly support of returning function that creating inside parent function?
I planned in rock.js support WebAssembly, and I work on solving most problems... For SIMD now can returned function that assign to another class (i.e. store).
The text was updated successfully, but these errors were encountered: