Navigation
Recherche
|
Why Wasm fascinates me
mercredi 12 mars 2025, 10:00 , par InfoWorld
WebAssembly fascinates me.
The notion of assembly language is as old as computing. Typically, assembly meant specific instructions for moving data around inside of a physical central processor. Everything in a computer is ones and zeros, but a layer above that is assembly code. To say that it is “human readable” is a bit of a stretch, but there are humans who can look at assembly and understand exactly what is going on, and even some who can use assembly to fine-tune things. Normally, we rely on a compiler to turn our higher-order languages like C++ or Object Pascal into assembly language that will run on bare metal. Each different processor would have its specific assembly language, and thus an executable from an Intel processor won’t run on an Arm-based system, and vice versa. Assembly usually ties you to a specific piece of physical hardware. But WebAssembly, or Wasm, is different. The idea behind Wasm is that it can be run anywhere. It represents a fundamental shift from hardware-based assembly languages. Wasm is designed from the ground up to be portable and to run securely across different environments. Up from assembly Much of the progression of computing has been to build layers of abstraction on top of previous layers that are more complex. Ones and zeros became assembly language. Assembly became Fortran, Cobol, and C. These languages compiled down to assembly. Then we added API levels like Windows that drove graphical user interfaces. Then came abstractions like the Java Virtual Machine (JVM) and the.NET runtime that separated us further from the raw machine code. They drove the notion of an executable to something that could theoretically be run on any operating system. From there, we abstracted things even further to running code in a browser. These days, the browser functions almost as an operating system, minimizing the developer’s dependency on the underlying OS. Chrome, for example, runs in Windows, Android, iOS, and macOS, executing code within its own controlled sandbox. It is a deeper abstraction than even the JVM or.NET runtime. And this is why Wasm fascinates me. It has the potential to really answer the call of “Write once, run everywhere.” That was the great hope of Java, but it didn’t take long for that aphorism to become “Write once, debug everywhere.” While Wasm doesn’t yet “run everywhere,” its use is steadily expanding beyond the browser. Broader adoption—particularly on the server side—seems inevitable. Right now, Wasm is most useful for doing computationally intense operations like gaming and encryption. Since the browser is the target for a large and ever-increasing portion of applications, it stands to reason that Wasm will become even more widely used. Rust, C/C++, and Go are probably the best known Wasm-capable languages, but any language can be compiled into Wasm. Part of my fascination is that TypeScript has yet to follow suit. It seems obvious to me that every day, it becomes more likely that the code we write will end up running in the browser, and a language targeted at web development seems like a natural candidate to support Wasm. The last mile Probably the biggest barrier right now is that Wasm doesn’t have an official way to access system-level resources like the file and networking systems. The WebAssembly System Interface (WASI) exists but is yet to be widely accepted and supported, particularly on the server side. Nor does Wasm have the notion of garbage collection, making support for languages like Java and C# difficult. Binding to web frameworks like React is still quite kludgy and requires interfacing with JavaScript. The bottom line is that Wasm has a way to go before it can be used as the language of the web. But, oh, the potential. Imagine a world where Wasm and WASI are common, bindings to the DOM enable web user interfaces, and the potential to build web applications in any programming language becomes a reality. In the medium term, Wasm’s utility will continue to grow and its ability to complement JavaScript will increase. It has its problems, and for at least the near-term, JavaScript will continue to be the lingua franca of the web. But it isn’t outlandish to think that it is merely a matter of time before Wasm does for the browser what Windows did for other languages. And I find that very fascinating.
https://www.infoworld.com/article/3843110/why-wasm-fascinates-me.html
Voir aussi |
56 sources (32 en français)
Date Actuelle
sam. 15 mars - 00:25 CET
|