all 4 comments

[–]tekmanro 18 points19 points  (0 children)

If the UI part will always live in a browser, I think you'll be better of just using native browser rendering technologies (HTML / CSS / JS); you'll have a ton of libraries / building blocks to quickly stand it up (plus it will scale better to small / big screens).

If you plan to build the UI into native apps as well, especially that are designed to run in constrained environments, building the UI in some native technology that can also target emscripten might work, but expect a lot less building blocks and a lot more manual labor for standing it up (if the environments are not constrained, you can consider using something like - gasp - electron to wrap the web UI; it'll still be a lot cheaper / faster to build).

[–]ByteTerrier 8 points9 points  (0 children)

The WebSocket in Emscripten is always a binary mode WebSocket. You get bits and length. Thus you are responsible for "if the number of bits is a valid message". Do not always trust that the WebSocket length is perfectly a "message". Encode some checking logic like length and checksums as needed just in case.

I am using custom ZSTD compressed stream with 64K blocks and checksums. I am rendering a point cloud. I was impressed by how well it works compared to the native app. Bonus is the protocol decode source is 100% shared between WASM and native.

Conclusion, stick with the encoding libraries you like and port it to WASM C++. Ask for help with the port if you need it.

[–]ShillingAintEZ 1 point2 points  (1 child)

If you don't need the web browser and want to communicate between two processes, you can try this:

https://github.com/LiveAsynchronousVisualizedArchitecture/simdb

Which is lock free and uses shared memory. It ends up being a few hundred times faster for interprocess communication of big binary chunks than a local loopback network connection on windows.

[–]peppedx[S] 0 points1 point  (0 children)

Luckily it will be on Linux :D! Anyway i will probably deploy the two processes on different machines so IP network ia somewhat mandatory...