I've been wanting to play around with Web Assembly for a while, and finally had a chance to. Since I'm a mostly Node.js developer, I wanted to play...
For further actions, you may consider blocking this person and/or reporting abuse
Do I need the emscripten glue code?
I am seeing errors like:
LinkError: WebAssembly.instantiate(): Import #1 module="env" function="_emscripten_get_heap_size" error: function import requires a callable
Hey! I am experiencing the same issue. I have used a 'c' code.
Do you know the solution to this issue?
Use emscripten and include the JavaScript gluecode and you won't have this issue.
Just to make sure I'm reading this correctly (the timestamps aren't totally clear to me), did your comment on my other post indicate you figured this out?
Correct, yes your other post helped me figure this part out.
I feel like I am 90% there with my experiment.
I also learned that if you're compiling C++ code with
em++
instead ofemcc
, make sure to includeextern "C"
in front of any functions in your C++ code that you want to access from JavaScript. Otherwise, you'll get errors that the function can't be found (cause of C++'s complicated name mangling rules).Is this why my exported functions are found in c but when I switch to cpp, my functions are undefined. I just refactored in rage for hours.
I bet that's it...if for no other reason because I was also refactoring in rage for some time too before I figured it out!
Oh man you are absolutely right, I am so happy! that is one of my many questions solved. seems like emscripten can only access C atleast with the similar code that you have. I'm trying to get Lua into node. Its proving ... challenging.
How long these directions will last valid ??
I mean, DynamSoft site is one year old and is already obsolete.
Must bet Node.js will kill PHP but why learn emscripten now?
And let consider HTML5. Why not learn also?
Where are Webmasters go? Who know?
And CGI is obsolete?
My website rely still on an NGINX system !!!
I just have a headache.
Bye.
Soooo...I just learned that apt-get has an emscripten package. You can install it with
sudo apt-get install emscripten
and I'm assuming it works the same. I haven't tested it yet though.With fastly moving things like this, you probably don't want to use that method for development setup. For the same reasons you don't install Node.js from default repo.
Agreed, and that is in fact what I ended up discovering.
Haha, well, launching an entire browser just to run some C is not something you see every day 😁
Good thing I'm not launching a browser 😉