Skip to content
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

Closed
ghost opened this issue Aug 26, 2016 · 3 comments
Closed

Lambda functions? #774

ghost opened this issue Aug 26, 2016 · 3 comments

Comments

@ghost
Copy link

ghost commented Aug 26, 2016

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).

@rossberg
Copy link
Member

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.

@qwertie
Copy link

qwertie commented Aug 26, 2016

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?

@titzer
Copy link

titzer commented Aug 26, 2016 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants