Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I've been using a similar stack (C++ and WASM) to build some simple applications and I enjoy it very much. For the UI components, text rendering and layout I use Dear ImGui [0] as I am very familiar with it and it allows me to implement GUIs very fast. The biggest convenience is that you can run the same code both as a native application and as a web app. The biggest drawback is you usually get 100% CPU usage when there is an active animation in the WebGL canvas because you need to redraw everything (similar to the OP's example).

If you are interested, checkout my Github template repo [1] - it contains a few examples:

[0] https://github.com/ocornut/imgui

[1] https://github.com/ggerganov/ggweb



That's exactly the stack I use as well: C++, OpenGL and Dear Imgui compiled via Emscripten. You can take a look at Hexmap [0] which is built this way.

All in all the performance is great for highly interactive stuff that does some fair amount of client side data processing.

[0] https://unit520.net/hexmap


Very cool! We do throttle our animations to the screen's refresh rate using requestAnimationFrame, so you shouldn't necessarily get 100% CPU unless the animation takes up the entire "frame budget" (on my machine the main example in the introduction is more like ~40-50% CPU on Chrome).


Usually not an issue with very interactive apps. We have a similar workflow targeting web and desktop, but Rust + WASM. Using BevyEngine for real-time apps, and Yew for web apps.


Oh cool; you're also using this for robotics I presume (based on your Twitter profile)? Makes sense; lots of data to process there.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: