How to use JS builtins (wasm:js-string) ? #24159
Closed
socketpair
started this conversation in
General
Replies: 1 comment
-
Since I already replied in llvm/llvm-project#136594 lets close this issue and continue the conversation there? IIUC you are likely the first person to try doing this do its not surprising there would be issues. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Here you can see an example of WASM code how to use
concat
JS builtin:https://developer.mozilla.org/en-US/docs/WebAssembly/Guides/JavaScript_builtins#wasm_module
So, in C I defined it in the following way:
Next, I'm trying to run the code that uses definition above in the following way:
Browser console says:
I guess, the problem in return value. in WAT language it should look like
(ref extern)
. How to express it in C (Clang)?https://github.com/WebAssembly/js-string-builtins/blob/main/proposals/js-string-builtins/Overview.md#wasmjs-string-concat
https://github.com/WebAssembly/function-references/blob/master/proposals/function-references/Overview.md#binary-format
Compiles perfectly well using
binryen
, but how write an equivalent using C and clang ?Beta Was this translation helpful? Give feedback.
All reactions