Hi, I am very new to emscriptem and I have been struggeling with porting a function from c++ to javascript.
I have created a public repo with my sample function, and I aim to implement feedback into it. https://github.com/taxfromdk/wasm-glm-nlohmann My overall mission is that I have some vector mathematics, that I would like to implement once and use on c++ and javascript platforms. I am using GLM as the vector-math-backbone, and I am under the impression that json is a good compromise for the languages involved. I have therefore chosen nlohmann's json library. https://github.com/g-truc/glm https://github.com/nlohmann/json >From what I can read, one strategy to communicate between js and c++, is using a shared memory buffer. I have therefore created an example function that takes a string and length as input and does, deserilization, computation and finally serialization to the same buffer before returning. The c++ part works fine, but i tend to get stuck on how to create a .wasm file I can use inside the javascript of a browser. I am on Ubuntu 20.04, and since the apt-get version of emscriptem seems to be ancient, I have based my sample on a docker container. emscripten/emsdk I have given it a shot by following https://wasmbyexample.dev/examples/strings/strings.c.en-us.html The guide seems to be somewhat outdated, and my attempts crumble as soon as I include my json library I intend to use. So I suspect I need to deal with some bindings between the json library and system. My docker instance does unfortunately not contain the tool wasm-objdump, which I suspect is needed to dig into said dependencies. That was a long intro, so thanx for having it made through it. I am seeking some pointers on how I would go from here. I hope to implement the advice in the repo for others to learn from. Kind regards Jesper -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/3055c60f-fc31-41bc-96ec-82dc6d2f0684n%40googlegroups.com.
