You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JavaScript runtimes have a rich set of builtin objects and primitives. Some languages targeting WebAssembly may have compatible primitives and would benefit from being able to use the equivalent JavaScript primitive for their implementation. The most pressing use-case here is for languages who would like to use the JavaScript String type to implement their strings. This proposal aims to provide a minimal and general mechanism for importing specific JavaScript primitives for efficient usage in WebAssembly code.
This is done by first adding a set of wasm builtin functions for performing JavaScript String operations. These builtin functions mirror a subset of the JavaScript String API and adapt it to be efficiently callable without JavaScript glue code. Then a mechanism for importing these wasm builtin functions is added to the WebAssembly JS-API. These two pieces in combination allow runtimes to reliably emit optimal code sequences for JavaScript String operations within WebAssembly modules. In the future, other JS builtin objects or JS primitives can be exposed through new wasm builtins.
Note: the proposal is championed by @eqrion of Mozilla. I'm filing this standards position issue as part of the Blink API process: Chrome is currently running an Origin Trial for this feature, and we expect to ship it once it's finalized.
The text was updated successfully, but these errors were encountered:
WebKittens
@ddegazio
Title of the spec
JS String Builtins
URL to the spec
https://github.com/WebAssembly/js-string-builtins/blob/main/proposals/js-string-builtins/Overview.md
URL to the spec's repository
https://github.com/WebAssembly/js-string-builtins
Issue Tracker URL
No response
Explainer URL
No response
TAG Design Review URL
w3ctag/design-reviews#940
Mozilla standards-positions issue URL
No response
WebKit Bugzilla URL
No response
Radar URL
No response
Description
JavaScript runtimes have a rich set of builtin objects and primitives. Some languages targeting WebAssembly may have compatible primitives and would benefit from being able to use the equivalent JavaScript primitive for their implementation. The most pressing use-case here is for languages who would like to use the JavaScript String type to implement their strings. This proposal aims to provide a minimal and general mechanism for importing specific JavaScript primitives for efficient usage in WebAssembly code.
This is done by first adding a set of wasm builtin functions for performing JavaScript String operations. These builtin functions mirror a subset of the JavaScript String API and adapt it to be efficiently callable without JavaScript glue code. Then a mechanism for importing these wasm builtin functions is added to the WebAssembly JS-API. These two pieces in combination allow runtimes to reliably emit optimal code sequences for JavaScript String operations within WebAssembly modules. In the future, other JS builtin objects or JS primitives can be exposed through new wasm builtins.
Note: the proposal is championed by @eqrion of Mozilla. I'm filing this standards position issue as part of the Blink API process: Chrome is currently running an Origin Trial for this feature, and we expect to ship it once it's finalized.
The text was updated successfully, but these errors were encountered: