Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
Moving onto the project, let’s first install Emscripten from their git repository. Emscripten will compile C into Wasm code. An important note is that I will be using Mac OS for this project. If you want to follow along using Windows, use this link. To Begin, open your terminal and clone down Emscripten with:
Before we get to the project, let’s explore what Web Assembly actually is. According to webassembly.org, Web Assembly, (Wasm) is a binary instruction format and virtual machine that allows developers to bring nearly any application to the web with near-native performance. Before Wasm, JavaScript was the only programming language available for web apps but in 2015 Google, Mozilla, Microsoft, Apple, and other tech companies announced a new project. In 2017, the first stable version of Wasm was released with the goal of enabling high-performance applications on the web. An important note however is that Wasm is not meant to replace JavaScript but rather work side-by-side. An example of this would be an HTML/CSS/JavaScript app with some modules such as video processing, animation, compression, etc. developed with WebAssembly for performance enhancement. The reason Wasm is so efficient compared to JavaScript is that JavaScript apps require so much abstraction from the CPU whereas Wasm can be compiled into assembly-like code that is then read by JavaScript and run on the browser at a much lower level. A real-world example of an application using JavaScript and Wasm is Figma, a popular collaborative application for design work.
git clone https://github.com/emscripten-core/emsdk.git