The blog posts have been published at https://medium.com/@eScienceCenter/using-c-in-a-web-app-with-webassembly-efd78c08469
Repository for draft blog post based on cpp2wasm guide.
- audience: RSEs
- approach: text before code, include code if it supports the story
- each blog has a focus and will try to minimize distractions, for example React blog should not use web worker and plot blog should use straight vegalite not react.
- each blog has its own code, will make sure all they expand the first blog
The blog topics are
- Using C++ in a web app with WebAssembly
- Help! My C++ web app is not responding
- Interact with your C++ web app using React forms
- Spice up your C++ web app with visualizations
- C++ web app with WebAssembly, Vega, Web Worker and React
Blog ideas:
- when stuff goes wrong, handling exceptions from C++
- computation takes too long for browser, use a web service running on a server with Fastify
- computation blocks my service, use thread pool
- My head can't process React, show the form using Vue.js
- I don't wanna learn a JS framework, give me a form with vanilla js
- I don't like JavaScript, give me Python, use pybind11 to interact with C++ from Python
- Expose C++ on the web using Python, use a web service running on a server with connexion
- is it done yet?, give progress during calculation, use Celery (Python)
- My C++ program needs sockets, can I use those? Explain limitations of Emscripten, use web socket and in-memory filesystem as examples
- How to build WebAssembly with a dependencies like boost, explain bundled standard libs and https://github.com/emscripten-ports
- Using a web worker and WebAssembly I would like to know how to report progress of the calculation back to the user. Also my computation should be stopped when the user submits again or presses a cancel button.
- Current code does not throw exceptions, but may be usefull to explain how to convert error number to message. See https://emscripten.org/docs/optimizing/Optimizing-Code.html#optimizing-code-exception-catching