- Abstract Syntax Tree is created. This tree represents the logical structure of the code.
- The tree is interpreted and replaced with the machine code understandable by the browser. Machines only understand binary code, so we need an interpreter to translate the language of programmers to the computer language.
- The next (but optional) step is the compilation of the code – its optimization. For example, if the compiler detects a looped process, it saves the results of the first operation and breaks the loop, reducing the load of the processor.
Why developers like WASM
Many programming languages, like C, C++, C#, Rust, or Go, can be compiled into WASM format. In other words: you can create an advanced desktop application in your favorite language, and then transfer it to the web with just a little effort.
let current_datetime = new Date();
document.getElementById(‘datetime’).innerText=”Today is ” + current_datetime.toString();
What is WebAssembly used for in the wild?
Thanks to WASM, it was possible to create full browser versions of large applications like AutoCAD or Doom 3 (yes, WebAssembly is a huge opportunity for online browser games!). Here are two interesting examples of WASM put into practice.
- Google Earth was written in C++ and designed as an application to be installed and run locally on a computer. Initially, no one even thought about moving the program to the web, because it required so much computing power. Google Earth processes insane amounts of data that must be displayed on the screen as a three-dimensional model of the globe. You need to use multiple processor threads at the same time for everything to run smoothly. WASM allows you to do this in a very effective way in your web browser. It required no major changes to the application code, and it was successfully transferred to the internet.
Will history repeat itself with WASM? It is difficult to say. WASM is a great improvement for web applications that require high computing power. Will anyone decide to generate other types of content using WASM? Maybe, which is why it’s worth knowing if Google is able to process it.
Can Google process WASM?
The test results show that Google has no technical problems with running WASM modules and reading the content generated by them. The page text has been fully indexed, and Google found links to subpages with no effort.
I’m not a developer, so cut to the chase!
Does WASM have a big impact on SEO? The best answer is… it depends.
Webpages are, in essence, paragraphs of text with pictures. With WASM, generating text is not as simple as you may think. This is because strings are not natively supported. A WASM application can “communicate” with the rest of the website only by using blocks of memory.
WebAssembly is a relatively new technology, even by IT standards. The process of building modules is not perfect yet. Modules are quite large, and loading them on a website is slow. Therefore, you should consider whether in the era of the increasing importance of web performance using WASM is the right approach. Will this new technology speed up the key operations on the website so much that it will offset the costs of using it? Every improvement we make on the website should be aimed to improve the user experience.