Skip to main content

Command Palette

Search for a command to run...

WebAssembly - Explained like to a five-year-old

Published
2 min readView as Markdown
WebAssembly - Explained like to a five-year-old

In this article, I am going to explain web assembly. We'll cover what web assembly is, its use cases, benefits, whether it will replace Java Script, and why you should learn web assembly.

Why do we need WebAssembly?

To build a website we need front and backend. Talking about the backend, there are many frameworks and programming languages, for example, ASP.NET by c#, Django by Python, and Laravel by PHP.

We can use different programming languages and frameworks in the backend, but the issue is why use different languages or frameworks? Why can't we use a single language or framework?

The simple answer is that if we work with one language it may not perform every task, it may not perform in every scenario. For example, if you need to build an AI-based web platform then Python in the backend will give you a good experience as its background is in Machine Learning and AI, if you need to build an Enterprise or Management based webplatform then C# will be a good choice, and if you want to make common webplatform then PHP will help you.

Due to different frameworks on the backend, we get a variety which we can get as different programming languages.

Talking about the front-end, there is only one technology that impresses us on the front-end that is JavaScript. I'm not questioning the potential of JavaScript, no doubt it's a very powerful language. Here I am talking about the part where Javascript does not perform well like 3D Design, Augmented Reality, Games. These areas require high graphics and insanely high-speed performance that is not provided by JavaScript.

In these areas, programming languages like C/C++ are very fast and powerful languages but we can't use them on front-end. There is another problem, if you have a desktop application and you want it to empower on the web, now you need to rewrite the whole program in JavaScript. Here web assembly becomes powerful, using web assembly you can directly transfer your program to the web without changing your code.

What is Web Assembly?

In web assembly, any programming language like C/C++, Rust their code is converted into assembly code and then you convert it into machine code which is understood by the browser. With this, a programming language which you cannot use on the web, now you can use it on the web, and every new browser supports web assembly.