WebAssembly for front-end web development. Emscripten vs Rust vs Blazor.
I was lucky to be involved in an evaluation of WebAssembly for an in-house web frontend project. The project basically involves an Admin Dashboard where a user logs in to monitor what is going on, looks at some sales charts and orders activities. In the evaluation, our goal is to determine whether it is feasible to use WebAssembly for front end web development, and if possible, build a prototype to prove the feasibility.
A better way to write Web Assembly
Signing WebAssembly Modules with Rust
In my book, I wrote an Appendix that included some code samples illustrating how to cryptographically sign WebAssembly modules, but these were more to illustrate some interesting Rust syntax rather than prescribe real-world, production patterns. For example, the signing in that appendix prepended a 64 byte blob to the Wasm binary, making it unusable by any of WebAssembly’s standard tooling (or parseable by regular hosts).
WebAssembly & CloudABI
ABI stands for Application Binary Interface (wiki page).
We can see an ABI as a contract between two binary applications, to assure that one binary is able to access certain native functions from the other binary.
Each time we compile a C or C++ application there is a set of system calls that the application will normally use, for example, to open a file, read its contents… or even opening a socket.
For doing that, the applications normally target the POSIX ABI to run these syscalls in Unix-like systems. There are different implementations following POSIX, such as libc, musl…
Read the article: https://medium.com/wasmer/webassembly-cloudabi-b573047fd0a9
Practice your Go WebAssembly with a Game
Marker Tracking in Babylon.js
Read the article: https://medium.com/@babylonjs/marker-tracking-in-babylon-js-ce99490be1dd
Running WebAssembly 100x faster 🔥
We’ve been working steadily to get Wasmer to execute WebAssembly modules on the server-side as fast as possible.
TL;DR — We got 100x improvement on startup time on Wasmer 0.2.0
Before getting into details, it’s essential to understand how Wasmer works under the hood to see what could be improved.
Read the article: https://medium.com/wasmer/running-webassembly-100x-faster-️-a8237e9a372d
Hyper efficient front end development with web assembly using Go and LLVM
I was very happy then when I came across tinygo, compile down a web assembly module and come to found it it makes WAY less assumptions and has a very simple based comment based system for importing functions — something to my knowledge currently impossible in the mainline Go compiler.
tinygo takes advantage of LLVM and is able to reduce web assembly modules to a pretty extreme amount pretty well. What this enables me to do is write very minimal modules like this hello world:
Write Web Assembly With LLVM
If you didn’t know. There’s a secret in the compiler community. LLVM can compile to web assembly. LLVM is a tool used by languages like Clang and Rust as a universial intermediate representation(IR) that can be compiled down to machine code output. Web assembly is one of those outputs.
In the early days of programming, hackers around the world participated in what was referred to as the “demo scene.” It still thrives today but I am mostly familiar with the “old school” phase that mainly involved using hardware hacks and other tricks to push personal computers to their limits. We could “trick” the video processor into drawing in areas it wasn’t supposed to and with clever timing produce more colors or sprites than were “allowed.” It was a fun time and I learned a lot.