Emscripten 7.0 Is Available, C/C++ To WebAssembly Compiler

Published release of the Emscripten 7.0 toolkit, which allows you to compile code in C/C++ and other languages for which LLVM-based frontends are available into universal low-level intermediate code WebAssembly. The resulting result can be used for integration with JavaScript projects, running in a web browser, using in Node.js, or creating stand-alone multi-platform applications launched using wasm runtime. The project code is distributed under the MIT license. The compiler uses developments from the LLVM project, and the Binaryen library is used to generate WebAssembly and optimization.

The main goal of Emscripten is the creation of a tool that allows you to execute code on the Web, regardless of the programming language in which this code was originally written. Compiled applications can use calls to standard C and C++ libraries (libc, libcxx), C++ extensions, pthreads-based multithreading, POSIX APIs, and many multimedia libraries. APIs for integration with Web API and JavaScript code are provided separately.
Emscripten supports broadcasting SDL2 library output through Canvas, and also implements support for OpenGL and EGLvia the WebGL API, which allows you to convert graphical applications and games to WebAssembly (for example, there is a port of the Qt toolkit, the Unreal Engine and Unity game engines are supported, as well as a physics simulation engine Bullet).

In addition to compiling code in C/C++ separately projects are being developed to run interpreters and virtual machines in browsers for the languages Lua, C#, Python, Ruby and Perl. It is also possible to use frontends for LLVM other than Clang, for example frontends for languages ​​like Swift, Rust, D and Fortran.

The 7.0 version number is due to changes that break compatibility. Main changes in Emscripten 7.0:

  • Direct linking of all additional modules with the runtime libraries libclang_rt.builtins and libclang_rt.profile is provided without the need to export from the main module, as is done in the compiler clang.
  • The libemcc library has been added, into which Emscripten-specific code has been removed from libclang_rt.builtins.
  • The libclang_rt.profile library has been separated from the libclang_rt.builtins runtime library, which is now used only when profiling is enabled (for example, when specifying the -fprofile-instr-generate or –coverage options).
/Reports, release notes, official announcements.