What languages support WebAssembly?

Updated on Apr 15, 2021webdevwasm

WebAssembly (Wasm) is the next big thing when it open the gate the web platform to all high-level programming languages beside the exclusive JavaScript.

Wasm is a low-level bytecode format that runs in the browser. It is designed to be faster to parse, as well as faster to execute which makes it a suitable compilation target for new and existing languages.

So currently which languages can be compiled to WebAssembly? Language conformance is largely determined by individual compiler support, there have been around 40 programming languages reported to support Wasm as a compilation target.

You can find all languages and tools that work with WebAssembly here. Notable languages are C/C++, C#/.NET, Rust, Java, Python, Elixir, Go. Take a took at several tools/frameworks related to WebAssembly:

  • Blazor: .NET web framework using C#/Razor and HTML that runs in the browser with WebAssembly.
  • JWebAssembly: Java bytecode to WebAssembly compiler. It uses Java class files as input. That it can compile any language that compile to Java bytecode like Clojure, Groovy, JRuby, Jython, Kotlin and Scala. As output it generates the binary format (.wasm file) or the text format (.wat file). The target is to run Java natively in the browser with WebAssembly.
  • Pyodide: Python scientific stack brings the Python runtime to the browser via WebAssembly, along with the Python scientific stack including NumPy, Pandas, Matplotlib, parts of SciPy, and NetworkX.
  • ElixirScript: A compiler to convert a subset (or full set) of Elixir code to JavaScript, providing the ability to write JavaScript in Elixir. This is done by taking the Elixir AST and converting it into JavaScript AST and then to JavaScript code. This is done using the Elixir-ESTree library.
  • Yew: A modern Rust framework for creating multi-threaded front-end web apps with WebAssembly. It features a component-based framework, has great performance by minimizing DOM API calls, and supports JavaScript interoperability.

WebAssembly support seems pretty early days and often self-labeled as experimental, I am hoping that the community continues to investigate and embrace WebAssembly.