Emscripten 3.0, C/C++ to WebAssembly compiler available

The release of the Emscripten 3.0 compiler has been published, which allows compiling code in C / C ++ and other languages ​​\uXNUMXb\uXNUMXbfor which there are LLVM-based frontends into a universal low-level WebAssembly intermediate code for subsequent integration with JavaScript projects, launch in a web browser, use in Node. js or building standalone multi-platform applications that run with wasm runtime. The project code is distributed under the MIT license. The compiler uses the developments of the LLVM project, and the Binaryen library is used to generate WebAssembly and optimize.

The main goal of the development of the Emscripten project is to create a tool that allows you to execute code on the Web, regardless of the programming language in which this code is written. Compiled applications can use calls to the C and C++ standard libraries (libc, libcxx), C++ extensions, pthreads-based multithreading, the POSIX API, and many multimedia libraries. Separately, APIs are provided for integration with the Web API and JavaScript code.

Emscripten supports translation of the output of the SDL2 library through Canvas, and also provides support for OpenGL and EGL through WebGL, which allows you to convert to WebAssembly, including graphical applications and games (for example, there is a Qt toolkit port and Unreal Engine 4 and Unit game engines are supported, physical Bullet engine). In addition to compiling code in C / C ++, projects are being developed separately to ensure the launch of interpreters and virtual machines in browsers for Lua, C #, Python, Ruby and Perl. It is also possible to apply non-Clang frontends to LLVM, available for languages ​​such as Swift, Rust, D and Fortran.

Major changes in Emscripten 3.0:

  • The musl C library used in emscripten has been updated to version 1.2.2 (version 2 was used in the Emscripten 1.1.15.x branch).
  • A portion of the functions that were mainly used inside the project have been removed from the parseTools.js library: removePointing, pointingLevels, removeAllPointing, isVoidType, isStructPointerType, isArrayType, isStructType, isVectorType, isStructuralType getStructuralTypeParts, getStructuralTypePartBits, isFunctionDef, isPossiblyFunctionType, isFunctionType, getReturnType, splitTokenList, _IntToHex, IEEEUnHex , Compiletime.isPointerType, Compiletime.isStructType, Compiletime.INT_TYPES, isType.
  • In the shell.html and shell_minimal.html templates, the output of error messages that occur during the operation of emscripten and issued by the application via stderr are switched by default to use console.warn instead of console.error.
  • Added the ability to specify a specific text encoding used in file names. The encoding can be specified as a suffix when passing the filename, such as "a.rsp.utf-8" or "a.rsp.cp1251").

Source: opennet.ru

Add a comment