Skip to content

NLESC-JCER/run-cpp-on-web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  1. Using C++ in a web app with WebAssembly
  2. Help! My C++ web app is not responding
  3. Interact with your C++ web app using React forms
  4. Spice up your C++ web app with visualizations
  5. C++ web app with WebAssembly, Vega, Web Worker and React

Blog ideas:

  1. when stuff goes wrong, handling exceptions from C++
  2. computation takes too long for browser, use a web service running on a server with Fastify
  3. computation blocks my service, use thread pool
  4. My head can't process React, show the form using Vue.js
  5. I don't wanna learn a JS framework, give me a form with vanilla js
  6. I don't like JavaScript, give me Python, use pybind11 to interact with C++ from Python
  7. Expose C++ on the web using Python, use a web service running on a server with connexion
  8. is it done yet?, give progress during calculation, use Celery (Python)
  9. My C++ program needs sockets, can I use those? Explain limitations of Emscripten, use web socket and in-memory filesystem as examples
  10. How to build WebAssembly with a dependencies like boost, explain bundled standard libs and https://github.com/emscripten-ports
  11. 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.
  12. 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