Cwrap/ccall belongs to asm.js or wasm or the both

21 views
Skip to first unread message

ssssss1

unread,
May 11, 2019, 9:28:19 AM5/11/19
to emscripten-discuss
Hello,

I want to ask you if the functions cwrap/ccall belongs to asm.js or wasm or the both, because when i use cwrap or ccall i use only the file .js not .wasm.


Thank you in advance.

Floh

unread,
May 12, 2019, 8:45:07 AM5/12/19
to emscripten-discuss
Some clarification: the .js file which is generated for wasm compile targets is not asm.js, it's regular Javascript and this is (mostly) needed so that the 
wasm (or asm.js) code can talk to the HTML5 APIs.

The ccall/cwrarp functions are part of the interop-code which simplifies calling from regular Javascript code into WebAssembly *or* asm.js code.

So I think it's correct to say that ccall/cwrap "belongs to" the Javascript code that's generated during compilation, but not to wasm or asm.js. 

Hind Tassn

unread,
May 13, 2019, 8:36:48 AM5/13/19
to emscripte...@googlegroups.com
Thanks a lot for the clarifications

2019-05-12 13:45 UTC+01:00, Floh <flo...@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to emscripten-disc...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/emscripten-discuss/73660f92-4b8a-497b-9cc2-6981f08d48ad%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
Reply all
Reply to author
Forward
0 new messages