DEV Community

Cover image for Webassembly Study Guide
Yuqing Ma
Yuqing Ma

Posted on

Webassembly Study Guide

Introduction
This article is only focusing on the future and advantages of Webassembly, but telling you the condition of
implementation for Webassembly in nowadays development.
Webassembly is a low-level language, unlike Python or JavaScript, so it is difficult to learn. It is newly
developed and lack of implementation such as, Exceptions or Closures, so the developer has problems to
translate some code from C or JavaScript directly to Webassembly. Therefore, if you want to use it in
industrial world, for client side, it is better to use AssemblyScript, which is built on WebAssembly , and its
packages. Also it is recommended to combination of languages and platforms for large applications. For
backend server, Webassembly is only a binary program and does not include an operating system
environment. We cannot replace Docker with it. At the same time, it is still suggested to use certain functions
or AI (TensorFlow) due to its properties.
AssemblyScript
It is easy to learn AssemblyScript as long as you learned TypeScript and JavaScript. Keep in mind that they
are only syntax similar and the basic logic is different. AssemblyScript provides standard low-level functions
that map directly to WebAssembly. Without AssemblyScript, developers need to use C, GO or Rust to achieve
the Emscripten function. With help of JavaScript framework, such as Vue, React, Angular, you can install the
AssemblyScript written package Lume, a 3D WebGL library. (https://github.com/lume/glas) Since the
WebAssembly takes less time and memory for animation and
video process, the website can be more efficient.
Compiling to WebAssembly
From the official website https://developer.mozilla.org/en-US/docs/WebAssembly/C_to_wasm, you can learn
how to setup environment and compile C to wasm file, which is binary file can be imported directly to JS file.
The tutorial on Youtube from Michael Grieco (https://www.youtube.com/watch?
v=RSLHrmDL4kU&list=PLysLvOneEETPM_YbEyZcJ35_3pSdrj33O&index=2&ab_channel=MichaelGrieco)
is great for beginner to learn the concept and use of C to wasm.
Conclusion
If you need a fast development for simple website and deal with small amount of user, you can scape
WebAssembly and keep using Docker. However, with the implementation of VR devices, the future website
requires lots of animation and 3D video process. WebAssembly will be the lead technology in this field.

Top comments (0)