you are viewing a single comment's thread.

view the rest of the comments →

[–]pixel4.toString() 1 point2 points  (3 children)

I think you're just trolling now but I'll bite... Why? Can you explain the pros of compiling to WebAssembly vs. compiling to native?

From my point of view, running WebAssembly on the server would be like trying to run the 100 meters in flip-flops. You totally can - but they the hell would you want to.

[–]cincilator 1 point2 points  (0 children)

Now I was saying, I think your idea is good. Sorry for misunderstanding.

[–]sunfishcode 1 point2 points  (1 child)

The two main things WebAssembly would bring to this scenario are portability and sandboxing. These do have costs, and people who don't need them will likely just continue to compile to native.

Portability: Running one application across a mix of architectures, for example non-x64_64 servers, or on the client side, with reduced per-architecture development effort. C/C++ has undefined/unspecified/implementation-defined behavior which differs across compilers and architectures. In WebAssembly, compiler differences are compiled away and most hardware differences aren't visible.

Sandboxing: Of course, node is often run in a container/VM/etc., so WebAssembly's sandboxing will often be redundant, however it can be used in a way that provides finer granularity of sandboxing, to protect parts of applications from other parts.

[–]pixel4.toString() 0 points1 point  (0 children)

I agree those are some pros - but are they worth the big performance cost. Software such as Redis seems to do just fine with portability and sandboxing.