| Emscripten | |
|---|---|
| Original author | Alon Zakai |
| Initial release | 22 October 2011 (2011-10-22)[1] |
| Stable release | |
| Repository | |
| Written in | C,C++,JavaScript[3] |
| Type | Compiler |
| License | MIT License,University of Illinois/NCSA Open Source License |
| Website | emscripten |
Emscripten is anLLVM/Clang-basedcompiler that compilesC andC++source code toWebAssembly,[4] primarily for execution inweb browsers.
Emscripten allows applications and libraries written in C or C++ to be compiled ahead of time and run efficiently in web browsers, typically at speeds comparable to or faster thaninterpreted ordynamically compiled JavaScript. It even emulates an entirePOSIX operating system, enabling programmers to use functions from theC standard library (libc).[5]
With the more recent development of theWebAssembly System Interface (WASI)[6] and WebAssemblyruntimes such asNode.js,Wasmtime,[7] andWasmer,[8] Emscripten can also be used to compile to WebAssembly for execution in non-Web embeddings as well.
Emscripten has been used toport a number of C/C++ code bases to WebAssembly, includingUnreal Engine 3,SQLite,[9]MeshLab,[10]Bullet physics,[11]AutoCAD,[12] and a subset of theQt application framework.[13] Other examples of software ported to WebAssembly via Emscripten include the following:
TheUnity,Defold, andGodot game engines provide an export option to HTML5, utilizing Emscripten.[14][15][16]Unreal Engine had this export option but it has been migrated out of the engine to a community member plug in.[17] TheSource Engine, has a community developed port for Emscripten dubbed "HalfLife2JS".[18]
openFrameworks exports native C++ applications to HTML5 via Emscripten.[19] emscripten-qt permits compiling applications written using theQt application framework to WebAssembly.[13]
In December 2014, theInternet Archive launched aDOSBox emulator compiled in Emscripten to provide browser-based access to thousands of archivedMS-DOS and PC programs.[20][21][22]
Emscripten was created by Alon Zakai in 2010, motivated by his desire to port his fork of the open-source first-person shooter gameSauerbraten, known asSyntensity,[23] to the web.Sauerbraten (also known asCube 2) is an open-source FPS game,[24] andSyntensity was Zakai's project that extended theCube 2 Engine for greater flexibility. Observing the increasing shift of applications to web browsers, Zakai began developing Emscripten as an LLVM-to-JavaScript compiler, aiming to make it possible to run existing C and C++ code, such as game engines, directly in the browser. In early blog posts, Zakai explained that his long-term goal was "to run Syntensity, or a smaller version of it, on the web",[25] and Emscripten was released as open source shortly after its initial development, making it available for the broader community to experiment with and contribute to.[26][27]
C: 40.0%; C++: 34.4%; #"ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=unknown&rft.jtitle=GitHub&rft.atitle=emscripten-core%2Femscripten%3A+Emscripten%3A+An+LLVM-to-JavaScript+Compiler&rft_id=https%3A%2F%2Fgithub.com%2Femscripten-core%2Femscripten%2Freleases&rfr_id=info%3Asid%2Fen.wikipedia.org%3AEmscripten">