WelcomeUser Guide
ToSPrivacyCanary
DonateBugsLicense

©2024 Poal.co

772

I was reading up on something called VTK. I guess it's a graphics library that is very common in high science related software like flow mechanics etc. I compiled it and it took over 20 minutes to compile. I was looking at the VTK website and it said it had a js implementation and I double took and said WTF I have to see this. It must be a HUGE js file. It said it was implemented with WebAssembly to a be subset of the c library. A subset of the c library. I took a look at seems like you can literally compile c / c++ into wasm that will actually run in a browser. Wtf is going on? Does anyone know about this?

I was reading up on something called VTK. I guess it's a graphics library that is very common in high science related software like flow mechanics etc. I compiled it and it took over 20 minutes to compile. I was looking at the VTK website and it said it had a js implementation and I double took and said WTF I have to see this. It must be a HUGE js file. It said it was implemented with WebAssembly to a be subset of the c library. *A subset of the c library*. I took a look at seems like you can literally compile c / c++ into wasm that will actually run in a browser. Wtf is going on? Does anyone know about this?

(post is archived)

[–] 1 pt

input language (frequently c/c++) -> wasm -> VM. All modern browsers have a jitting VM availble. Once loaded into the VM, usually, but not a requirement, a jitting VM then compiles it into native code. The WASM itself is not well optimized as it assumes the VM target will itself compile and optimize it into native code.

For my own use, I have used clang C++ -> WASM -> custom/compress WASM -> Custom WASM VM interpreter, for an embedded target. Thus no jitted VM.

[–] 0 pt

Fascinating do you think it's actually viable to make a native / cross browser app in c++? or does c in the browser through webassembly have too many significant limitations?

[–] 1 pt

I know good performance is possible but as my experience is far outside of browsers I can't speak to your expectations.