Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Webassembly end up as rendered HTML in the browser?

Webassembly can compile say C# to bytecode, executable by the browser.What is its rendered form in the browser? HTML with JavaScript? Or something like Silverlight or a Java applet that runs inside the browser such as a business app with rich GUIs?

like image 331
microwth Avatar asked Oct 05 '18 17:10

microwth


People also ask

Does WebAssembly use HTML?

The WebAssembly file itself, with the extension . wasm, is a binary format containing executable instructions. To use the file, you must write an HTML file that runs some Javascript to fetch, compile and execute the WebAssembly file.

How does a browser WebAssembly work?

WebAssembly is a low-level assembly-like language with a compact binary format that runs with near-native performance and provides languages with low-level memory models such as C++ and Rust with a compilation target so that they can run on the web.

What does WebAssembly compile to?

The WebAssembly. compile() function compiles WebAssembly binary code into a WebAssembly. Module object. This function is useful if it is necessary to a compile a module before it can be instantiated (otherwise, the WebAssembly.

Can WASM run in the browser?

Webassembly (WASM) is one of the most disruptive technologies at this moment. WASM enables us to run programs in the browser that was written in programming languages not supported by the own browser. We can do it because some programming languages can be compiled into WASM and WASM is supported by all the browsers.


1 Answers

Your application code written in C# is compiled into asp.net assembly, and is managed by the mono run time, which was compiled to WebAssembly. What is rendered in the browser is html through manipulation of the DOM using JavaScript interop; that is, your C# code communicate with JavaScript code to manipulate the DOM, and rerender the diffs.

like image 80
enet Avatar answered Oct 28 '22 02:10

enet