Mozilla specialists have introduced the WASI (WebAssembly System Interface) project, which involves developing APIs for creating ordinary applications that run outside the browser. Initially, the focus is on cross-platform compatibility and a high level of security for such applications.

As noted, they run in a special 'sandbox' and have access to files, the file system, network sockets, timers, and so on. The program can only perform actions that are explicitly permitted.
Given that the pseudocode of WebAssembly is a platform-independent version of the Assembler language, using JIT will allow for high code performance, on par with native applications. Currently, a basic implementation of POSIX APIs (files, sockets, etc.) is presented, but it does not yet support locks and asynchronous input/output. Future modules for cryptography, 3D graphics, sensors, and multimedia are expected.

It is also worth noting that Fastly has introduced the Lucet compiler for WebAssembly applications. It allows safe execution of third-party programs on WebAssembly within other applications, making it suitable for plugins. The compiler itself is written in Rust and supports code in C, Rust, and TypeScript.
Of course, there are still many questions regarding the security of such an approach. Executing code in a 'sandbox' strangely combines with access to the main system's functions, so this issue requires further clarification. Additionally, it is unclear which specific programs should operate in such a mode and how their behavior should be monitored.
Source: 3dnews.ru
