Published on 04/24/25
The WebAssembly revolution
In this article, we'll take a look at WebAssembly, a technology that could enable you to discover a new way of developing your web applications using modern, reliable and robust programming languages such as Rust, Go, Zig or V.
Once upon a time, there was JavaScript
Created in ten days in May 1995 by Brendan Eich for Netscape Communications, JavaScript is an interpreted, dynamic, low-typing programming language. It was originally designed to make web pages more interactive, but was not really intended to become so central to the Web ecosystem. It therefore gradually gained in power, eventually occupying a predominant place in the design of web interfaces, with frameworks such as React or VueJS, for example, but also application backends thanks to the Node.js runtime environment or its challenger Bun.
Because of its somewhat rapid genesis, some would even say that it's a badly born language, it comes with its share of small flaws and drawbacks, some of which have been corrected or erased over time. There are more or less numerous shortcomings and drawbacks, depending on the case and the usage, but if we could retain only two, they would be the following in my opinion:
- Weak typing, with syntax rules and behaviors that are sometimes very strange, easily misleading and leading to malfunctions that are sometimes difficult to identify; I can only advise you to watch this hilarious lighning talk on the subject: https: //www.destroyallsoftware.com/talks/wat
- A level of performance that can be problematic for certain demanding and/or critical applications. This is due to the fact that it is still an interpreted language, which can be more or less costly at runtime, although virtual machines have made considerable progress in recent years by integrating JIT (dynamic on-the-fly recompilation), for example.
But is it really possible to do without JavaScript for web development? Yes, thanks to WebAssembly...
Then came WebAssembly
Ten years ago now, in 2015, the W3C pondered the question: how to replace or support JavaScript while offering high performance and allowing users to choose their preferred language? The answer was the creation of WebAssembly, abbreviated as WASM (pronounced "wazeum").
This standard consists of :
- A binary bytecode, a kind of machine language but abstracted from any physical hardware standard.
- Its textual representation, a low-level language resemblingassembler.
- A sandboxed execution environment to isolate program execution for greater security.
Unlike JavaScript, WebAssembly specifies only very low-level elements. The bytecode representing your program is produced by compiling the high-level language of your choice, and this is its great strength.
The languages used to generate WebAssembly can be very diverse:
This list includes the most common languages, but is by no means exhaustive.
WebAssembly will enable you to design high-performance, resource-efficient applications, while leaving you free to choose your preferred language and the technologies best suited to your project. You'll be able to develop business applications, security applications, frontends, backends and even video games...
For example, it's possible to adapt the video game classic Doom to run in your browser, as demonstrated here.
In short, WebAssembly is a promising technology. It is capable of offering far greater security and performance than traditional JavaScript, thanks to its ability to execute compiled code at near-native speeds, while remaining usable directly in the browser or on the server side.
Which language to choose?
With WebAssembly, there's only one choice to make: the programming language. But which one to choose? As always in software development, there's no universal answer to this question. But let me introduce you to a few languages I think you should pay particular attention to.
Rust: security and performance
Developed in 2006 by Graydon Hoare, an engineer at Mozilla, this language was first developed as a personal project, then from 2009 as a project of the foundation, which used it for certain components of its Firefox browser, notably the Servo rendering engine. Over time, Rust has established itself as one of the most popular languages for system and low-level development, thanks in particular to its performance, which is close to that of C and C++, but also to the very concrete solutions it provides to memory management and security issues.
Rust's strengths
- It offers high performance and is ideal for applications requiring speed and low resource consumption.
- It guarantees memory security thanks to specific memory allocation/release semantics and a "borrow checker" control system.
- It is particularly well supported by a growing community, as well as by technology giants such as Microsoft, Amazon and Google, and has recently entered the Linux kernel to complement C language development.
- It is well-suited to compiling to WebAssembly, offering excellent performance on the browser as well as on the server side via WASI, the WebAssembly System Interface, providing a link to system layers while guaranteeing a high level of security.
Rust's weak points
- A steep learning curve.
- Syntax is not always crystal-clear.
- Some concepts can be confusing, especially when it comes to understanding and mastering memory management and its ownership model.
- The official compilation chain is rather slow compared to other languages, but is improving with time.
Go: simplicity and competition
Conceived in 2007 by Robert Griesemer, Rob Pike and Ken Thompson at Google, this language was officially released in 2009 and was intended from the outset to be the natural successor to C for back-end development and command-line tools. It was designed to facilitate the writing of robust, easy-to-maintain distributed applications.
Go's strengths
- Simple, readable syntax for rapid learning.
- It offers an elegant model for concurrent programming thanks to goroutines, facilitating the development of high-performance distributed applications.
- It compiles quickly, even very quickly, and can be used to generate fairly lightweight applications.
- It can compile to WebAssembly, making it easier to write web applications and simplifying the porting of existing services to the web, while maintaining good performance.
Go's weak points
- WebAssembly performance is generally inferior to that of Rust, mainly due to its runtime and concurrent programming model.
- Memory management is based on a garbage collector, which can lead to latency in some cases.
Zig: speed and interoperability
Zig is a language designed by Andrew Kelley and released in 2015. It focuses on simplicity, security and performance. It is close to the philosophy of the C language, but with a more modern and secure approach. It brings very advanced interoperability, being able itself to compile C and C++ natively, so it can benefit from and interface with a very extensive software library at zero cost.
Zig's strengths
- Excellent performance, close to or equivalent to C.
- Explicit, secure memory management.
- It can generate WebAssembly, making it relatively easy to create applications in a web ecosystem.
Zig's weak points
- The ecosystem is still rough, and the developer experience is still perfectible.
- The community is not yet very well developed.
V: ultra-fast, ultra-light and ultra-promising
Last on this list and the outsider: V is a young language, very young indeed. Created by Alex Medvenikov, it appeared in 2019 with a very bold ambition: to combine the simplicity of a language like Go with the execution speed of a language like C or Rust. Its syntax is largely inspired by Go and is intended to be minimalist and rather intuitive. It's a very interesting language and ecosystem to keep an eye on.
V's strengths
- Simple syntax with a steep learning curve.
- It offers extremely fast compilation times: projects written in V literally compile at lightning speed.
- Very low memory footprint.
- Extremely high execution speed.
- It can generate WebAssembly, making V an attractive choice for developing high-performance applications in the browser or on the backend.
V's weak points
- The language and ecosystem are still very young. At the time of writing, the language is at version 0.4.0 beta, but still offers great stability in syntax, programming interfaces and generated programs.
- Not yet mature enough for production use.
Conclusion
JavaScript still has a strong presence in the world of web development, and it's not ready to give up the ghost just yet, because it's still perfectly suited to certain needs.
On the other hand, when it becomes necessary to go further and reach its limits, WebAssembly can provide solutions to your challenges in terms of performance, stability, security, resource management and so on.
In this case, it's essential to look at the alternatives offered by other programming languages. Each of these languages can provide an elegant response to the limitations you may encounter, whether on the frontend or the backend... the only remaining limit being ultimately that of your imagination.
To find out more
If you'd like to find out more, I recommend a few resources:
The revolution (wasm) is incredible because it's true
Presentation at Devoxx France 2023: https://youtu.be/ePnnbRHdNsI
By :
- Philippe Charrière, Principal Solutions Architect at Docker Inc.
- Laurent Doguin, Director, Developer Relation & Strategy at Couchbase.
Liberate WebAssembly from the browser ... With WASI
Presentation at DevFest Nantes 2022: https://youtu.be/a21VuaKWLIg
By :
- Philippe Charrière, Principal Solutions Architect at Docker Inc.
Server side WASM, the next game changer?
Presentation at DevFest Nantes 2024: https://youtu.be/ziBaoZTOj0Q
By :
- Etienne Anne, Fullstack developer at MAIF
- Mathieu Ancelin, CTO and co-founder of cloud APIM and creator of Otoroshi, which integrates WASM.
How I found the meaning of life thanks to WebAssembly
Presentation at Devoxx France 2024: https://youtu.be/I87Lw4ohAmU
By :
- Théo Gianella, consultant at Zenika
Porting DOOM to the browser with SDL2 and Emscripten
Presentation on Twitch, March 2024: https://youtu.be/To6uxSdK2T0?t=380
By:
- Olivier Poncet, CTO at Arneo
You can test DOOM in your browser here. Similarly, you can rediscover the classic "Another World" in your browser here.
These articles may be of interest to you
Would you like to talk about it?
According to my analysis
Are you interested in our projects and our expertise? Why don’t we have a chat?
Your browsing inspires our AI to offer you tailor-made content.
For eco-design, let’s moderate its use.