admin

@admin

Posts made by admin

Hello! August 24, 2018, released version Go 1.11 with the experimental support of WebAssembly (Wasm). The technology is interesting and I immediately had a desire to experiment. To write “Hello World” is boring (and it, by the way, is in the documentation), especially the trend of the last summer of the article from the series “How to make users search on GitHub <insert your favorite JS-framework>”

Ethereum’s conception back in 2013 came as a major extension of blockchain technology as a decentralized settlement layer for p2p money into a trustless layer for execution of programs, opening up an entirely new world of applications and programmable money.

Being heralded as a game changer for the Web and performant, cross- browser execution, WebAssembly is a standard being developed by the W3C group for an efficient, lightweight instruction set. This means we can compile different types of programming languages ranging from C/C++, Go, Rust, and more into a single standard that can be run almost natively in browsers as an alternative to JavaScript. WebAssembly, or WASM, for short, is memory-safe, platform independent, and maps well to all types of CPU architectures efficiently.

If you have tried the ‘hello world’ example of Dynamsoft JavaScript Barcode SDK, you should know that the SDK is built based on WebAssembly technology, which allows you to develop web client-side barcode reader app in pure JavaScript. The simple example demonstrates how to decode barcode from an input file.

However, in most scenarios, a web barcode reader features real-time decoding for camera video stream. The principle for building a camera app is don’t block the UI thread. If you call the barcode API in JavaScript main thread and the API takes more than 100ms to decode barcodes, the UI cannot render smoothly. That is why we need to use web workers.

When using WebAssembly, it may take a long time to download and compile the wasm file. Dynamsoft provides two JavaScript barcode editions built with different optimization levels which influence the final wasm file size and initialization time.

WebAssembly, or WASM, is a new technology that enables code to be compiled and run faster in web and server applications. In this project, webpack-sources, one of the core packages of Webpack, and its dependencies source-list-map and source-map are re-written in Rust and compiled to WebAssembly binary to speed up the webpack bundling time. The new package is designed to be API compatible with the previous version in JavaScript, and you can substitute for the old package directly without any modifications in Webpack and plugins.

Although it has not yet been released as a default dependency in Webpack, you can simply try it out with webpack-cli. See the Github project for more information.

WebAssembly and Web Components are two emerging standards that have a big chance of significantly influencing the future of web as a platform. And the interesting question is, can we combine the two technologies? Can we create a Web Component using WebAssembly? Find out here.

In every browser, whether you use Chrome, Firefox, Edge, or Safari, code is interpreted and executed by a JavaScript engine — which only runs JavaScript. Unfortunately, JavaScript is not ideal for every task we want to perform. That’s where WebAssembly steps in.

WebAssembly Studio utilizes an open source code editor called Monaco Editor that is also used to power the oh-so popular VSCode. The size of the Monaco Editor dependency is pretty extensive, roughly around 15mb. This becomes smaller when minimized and gzipped of course, but it is still a lot to download on an initial page load (especially for users with slow connections).

The scenario below is a bit simplified but explains (in broad terms) what used to happen on the initial page load. Before the user interface (UI) could be rendered, the whole Monaco Editor dependency had to be loaded.

The reason WebAssembly appealing to me, besides the performance, is that I can run WebAssembly either on client-side or server-side. In this post, I will share how to build WebAssembly file and run it with Node.js.