Emscripten

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
Emscripten
Original authorAlon Zakai
Initial release22 October 2011 (2011-10-22)[1]
Repository
  • {{URL|example.com|optional display text}}Lua error in Module:EditAtWikidata at line 29: attempt to index field 'wikibase' (a nil value).
Written inC, C++, JavaScript[2]
Engine
    Lua error in Module:EditAtWikidata at line 29: attempt to index field 'wikibase' (a nil value).
    TypeCompiler
    LicenseMIT License, University of Illinois/NCSA Open Source License

    Emscripten is an LLVM/Clang-based compiler that compiles C and C++ source code to WebAssembly,[3] primarily for execution in web 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 than interpreted or dynamically compiled JavaScript. It even emulates an entire POSIX operating system, enabling programmers to use functions from the C standard library (libc).[4]

    With the more recent development of the WebAssembly System Interface (WASI)[5] and WebAssembly runtimes such as Node.js, Wasmtime,[6] and Wasmer,[7] Emscripten can also be used to compile to WebAssembly for execution in non-Web embeddings as well.

    Usage

    [edit | edit source]

    Emscripten has been used to port a number of C/C++ code bases to WebAssembly, including Unreal Engine 3, SQLite,[8] MeshLab,[9] Bullet physics,[10] AutoCAD,[11] and a subset of the Qt application framework.[12] Other examples of software ported to WebAssembly via Emscripten include the following:

    Game engines

    [edit | edit source]

    The Unity, Defold, and Godot game engines provide an export option to HTML5, utilizing Emscripten.[13][14][15] Unreal Engine had this export option but it has been migrated out of the engine to a community member plug in.[16] The Source Engine, has a community developed port for Emscripten dubbed "HalfLife2JS".[17]

    Frameworks & toolkits

    [edit | edit source]

    openFrameworks exports native C++ applications to HTML5 via Emscripten.[18] emscripten-qt permits compiling applications written using the Qt application framework to WebAssembly.[12]

    Software archiving

    [edit | edit source]

    In December 2014, the Internet Archive launched a DOSBox emulator compiled in Emscripten to provide browser-based access to thousands of archived MS-DOS and PC programs.[19][20][21]

    Creation

    [edit | edit source]

    Emscripten was created by Alon Zakai in 2010, motivated by his desire to port his fork of the open source first-person shooter game Sauerbraten, known as Syntensity,[22] to the web. Sauerbraten (also known as Cube 2) is an open source FPS game,[23] and Syntensity was Zakai's project that extended the Cube 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",[24] 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.[25][26]

    See also

    [edit | edit source]

    Lua error in mw.title.lua at line 392: bad argument #2 to 'title.new' (unrecognized namespace name 'Portal').

    References

    [edit | edit source]
    1. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    2. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    3. ^ WebAssembly · emscripten-core/emscripten Wiki · GitHub
    4. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    5. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    6. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    7. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    8. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    9. ^ http://www.meshlabjs.net - Homepage of the experimental, client based, javascript, version of MeshLab that runs inside a browser
    10. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    11. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value)..
    12. ^ a b Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    13. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    14. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    15. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    16. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    17. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    18. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    19. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    20. ^ Each New Boot a Miracle by Jason Scott (December 23, 2014)
    21. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    22. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    23. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    24. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    25. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    26. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    [edit | edit source]