DEV Community

Discussion on: Create Excel-like javascript spreadsheet in less than 10 lines of code

peerreynders profile image

No more bloat, because the C# IL and subsequent machine code don't have it.

I don't agree. The bloat exists in the form of the .NET CLR which isn't present on browser- the JavaScript runtime already exists on all browsers. And for the time being each isolate/thread/worker would need it's own copy of the runtime in memory which can add up pretty quickly especially on resource constrained devices.

WebAssembly is an attractive option for languages with minimal run times like C/C++, Rust and perhaps even AssemblyScript but due to their comparatively slow development cycles will most likely be optimizations rather than main application development (there will always be exceptional niche cases).

In many cases using JavaScript as a compilation target will still make more sense in order to take advantage of the existing capabilities rather than having to design some minimal purpose designed WebAssembly runtime (especially during product inception).

Some C# dialect to generate WebAssembly against some minimal Web API specific runtime via WASI perhaps but there is no advantage going through the CIL.

Thread Thread
jwp profile image
John Peters

I don't agree with that either. C# is able to deliver code that's pre-compiled and fully optimized at the machine layer. Apart from a one time CLR load the bloat comparison holds no water. Javascript only goes to the IL layer which always interprets into machine code. Optimization with Jit are inferior, they don't have time to do the same thing as multipass compilers. Minus the one time CLR load WASM is super fast. It's ultimate niche is with those needing ultra secure run time.