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

WebAssembly js-types API #532

Closed
1 task done
Ms2ger opened this issue Jun 30, 2020 · 8 comments
Closed
1 task done

WebAssembly js-types API #532

Ms2ger opened this issue Jun 30, 2020 · 8 comments
Assignees
Labels
Progress: propose closing we think it should be closed but are waiting on some feedback or consensus Review type: CG early review An early review of general direction from a Community Group Topic: scripting ECMA, Web Assembly bindings, etc. Venue: WebAssembly CG

Comments

@Ms2ger
Copy link

Ms2ger commented Jun 30, 2020

Saluton TAG!

I'm requesting a TAG review of the WebAssembly js-types API.

WebAssembly is typed, and its types carry information that can be useful and important to clients interacting with WebAssembly modules and objects through the JS API. For example, types describe the form of imports and exports, including the size limits of memories and tables or the mutability of globals. This proposal adds respective functionality to the WebAssembly JS API in a systematic manner.

Further details:

  • I have reviewed the TAG's API Design Principles
  • The group where the incubation/design work on this is being done (or is intended to be done in the future): WebAssembly CG
  • The group where standardization of this work is intended to be done ("unknown" if not known): WebAssembly WG
  • Existing major pieces of multi-stakeholder review or discussion of this design: not aware of any
  • Major unresolved issues with or opposition to this design: Design of WebAssembly.Function.
  • This work is being funded by: Igalia

We'd prefer the TAG provide feedback as (please delete all but the desired option):

🐛 open issues in our GitHub repo for each point of feedback

@Ms2ger Ms2ger added Progress: untriaged Review type: CG early review An early review of general direction from a Community Group labels Jun 30, 2020
@hober hober added Topic: scripting ECMA, Web Assembly bindings, etc. Venue: WebAssembly CG labels Jun 30, 2020
@kenchris kenchris self-assigned this Jul 8, 2020
@plinss plinss added this to the 2020-07-20-week milestone Jul 8, 2020
@Ms2ger
Copy link
Author

Ms2ger commented Sep 16, 2020

Fwiw, Igalia is currently implementing in SpiderMonkey and will likely start on implementing in JSC soon. Feedback soon would be very welcome.

@kenchris
Copy link

kenchris commented Sep 23, 2020

function print(...args) {
  for (let x of args) console.log(x + "\n")
}

let table = new Table({element: "anyfunc", minimum: 10});

let print_i32 = new WebAssembly.Function({parameters: ["i32"], results: []}, print);
table.set(0, print_i32);
let print_f64 = new WebAssembly.Function({parameters: ["f64"], results: []}, print);
table.set(1, print_f64);
let print_i32_i32 = new WebAssembly.Function({parameters: ["i32", "i32"], results: []}, print);
table.set(2, print_i32_i32);

In the above example where you are exporting a JS function to Wasm, wouldn't it makes sense it I could supply meta data (in the WebAssembly.Function call) that would be given to the print method when run, so that I could change the formatting.

@hober
Copy link
Contributor

hober commented Sep 23, 2020

This first example seems awfully convoluted. Is there also a higher-level API that does some of this work for you? If we can't improve upon what Emscripten already does for people, why will they bother to switch?

@kenchris
Copy link

The WebAssembly.imports() function returns an array containing descriptions of all the declared imports of the given Module.

I found it quite confusing that imports is actually returning a description and not doing any importing.

@hober
Copy link
Contributor

hober commented May 12, 2021

@Ms2ger, any thoughts on the observations @kenchris & I made in September?

@torgo
Copy link
Member

torgo commented Sep 16, 2021

Hi we are just noting this is still pending feedback from the requestor. @Ms2ger should we close this?

@torgo torgo added this to the 2021-09-20-week milestone Sep 16, 2021
@torgo torgo added the Progress: propose closing we think it should be closed but are waiting on some feedback or consensus label Sep 16, 2021
@hober
Copy link
Contributor

hober commented Dec 7, 2021

Hi @Ms2ger,

We're closing this issue due to the lack of response here & in WebAssembly/js-types#26. If you come back to this project at some point and would like us to revisit, we'd be happy to reopen this, or you could file a new request.

@hober hober closed this as completed Dec 7, 2021
@Ms2ger
Copy link
Author

Ms2ger commented Dec 8, 2021

@hober apologies for my lack of availability here - I'm hoping to get back to this next year.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Progress: propose closing we think it should be closed but are waiting on some feedback or consensus Review type: CG early review An early review of general direction from a Community Group Topic: scripting ECMA, Web Assembly bindings, etc. Venue: WebAssembly CG
Projects
None yet
Development

No branches or pull requests

5 participants