WebAssembly (Wasm) is a binary instruction format that can be executed in modern web browsers. It is designed to be an efficient and portable target format that can be compiled from multiple programming languages. The following are programming languages that can be compiled to WebAssembly:
- C/C++ - C/C++ code can be compiled to Wasm using the Emscripten compiler toolchain.
- Rust - Rust has built-in support for WebAssembly and can be compiled to Wasm using tools like
wasm-packandcargo-web. - AssemblyScript - AssemblyScript is a language similar to TypeScript syntax, designed specifically for compiling to WebAssembly.
- Go - Go has experimental support for compiling code to Wasm.
- Kotlin/Native - Kotlin can be compiled to Wasm using Kotlin/Native.
- Blazor (C#) - C# code can be compiled to Wasm using the Blazor framework.
- Dart - Dart can be compiled to JavaScript via Dart2js or other tools, and the resulting JavaScript can be executed in the browser; however, for WebAssembly, Dart can be compiled directly using specific tools.
- Python - Python code, along with scientific computing stacks, can be compiled to Wasm using the Pyodide project.
- Zig - Zig can be compiled to WebAssembly.
Most of these languages provide official or community-driven toolchains that can compile their source code to WebAssembly. As the WebAssembly ecosystem matures, more programming languages are expected to gain support for compiling to Wasm.
2024年6月29日 12:07 回复