In the world of modern web development and high-performance applications, WebAssembly (Wasm) and the programming language Rust are two technologies that increasingly go hand in hand. Their combination enables developers to create highly optimised, security-critical software that achieves impressive speeds both on the server and directly in the browser.

With Rust, many of the classes of problem simply go away, by design. At the same time, software written in it is compatible with existing software written in C. What this means is that we can start to slowly migrate to Rust and significantly improve our security as a result.
Ivan Ristic, software engineer and founder of SSL Labs
What makes Rust special is its unique combination of performance, security and productivity. It is a system programming language that offers the speed of C++, but at the same time guarantees memory safety and thread safety through an innovative “ownership” and “borrowing” model, without the need for a garbage collector. This means that many of the most common errors, such as memory leaks or data conflicts in parallel execution, are already detected and prevented at translation time (compile time). In addition, there is an excellent ecosystem with the package manager Cargo, useful error messages from the compiler and a growing, dedicated community that facilitates the development of reliable and efficient software.
As usual in the world of programming languages, I’ll show you the translatable and executable minimal program (for those who haven’t touched Rust yet):
fn main() {
println!("Hello, world!");
}
This tells the Rust compiler that when the program is executed, it should simply print the string Hello, World! (For the nerds: It appends a new line and the output is stdout).
The exclamation mark indicates that println!() is a macro. This is due to functional safety and language design reasons. However, this should not bother beginners of the language, because println!() can simply be regarded as a function here for now.

My experiment Rusty Pi Cake uses Rust to generate Wasm code that can be executed on all modern browsers on the web and answers the initial question with a clear yes.
A web worker is started in the browser parallel to the main thread. Put very simply, the main thread is where the browser performs all the calculations to display the page, execute code and wait for user interactions, etc. A very computationally intensive task is then carried out in the so-called web worker; for demonstration purposes, π is calculated with specified precision. If the calculation were to be carried out in the main thread (the normal case), the page would no longer be interactive and, for example, a progress bar would no longer be updated: the page would be blocked.
All active components are written in Rust and are compiled as WebAssembly and executed by the browser. This requires a kind of framework, which is written in Javascript and loads the Wasm code. That’s why it doesn’t work entirely without Javascript.
cargo install trunk)rustup target add wasm32-unknown-unknown