Software:Emscripten
Original author(s) | Alon Zakai |
---|---|
Stable release | 3.1.32
/ 17 February 2023[1] |
Written in | C, C++, JavaScript[2] |
Type | Compiler |
License | MIT 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] (or to a subset of JavaScript known as asm.js,[4] its original compilation target before the advent of WebAssembly in 2017), 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).[5]
With the more recent development of the WebAssembly System Interface (WASI)[6] and WebAssembly runtimes such as Node.js, Wasmtime,[7] and Wasmer,[8] Emscripten can also be used to compile to WebAssembly for execution in non-Web embeddings as well.
Usage
Emscripten has been used to port a number of C/C++ code bases to WebAssembly, including Unreal Engine 3, SQLite,[9] MeshLab,[10] Bullet physics,[11] AutoCAD,[12] and a subset of the Qt application framework.[13] Other examples of software ported to WebAssembly via Emscripten include the following:
Game engines
The Unity, Defold, and Godot game engines provide an export option to HTML5, utilizing Emscripten.[14][15][16] The Unreal Engine had this export option but it has been migrated out of the engine to a community member plug in.[17]
Frameworks & toolkits
openFrameworks exports native C++ applications to HTML5 via Emscripten.[18] emscripten-qt permits compiling applications written using the Qt application framework to WebAssembly.[13]
Software archiving
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]
See also
- asm.js
- Google Native Client (PNaCl)
- WebAssembly
References
- ↑ "emscripten-core/emscripten: Releases". https://github.com/emscripten-core/emscripten/releases.
- ↑ "emscripten-core/emscripten: Emscripten: An LLVM-to-JavaScript Compiler". https://github.com/emscripten-core/emscripten/releases. "C: 40.0%; C++: 34.4%; JavaScript: 17.4%."
- ↑ WebAssembly · emscripten-core/emscripten Wiki · GitHub
- ↑ Walton, Zach (2012-04-04). "Easily Port C++ To HTML5/JavaScript With Emscripten". WebProNews. iEntry Network. http://www.webpronews.com/easily-port-c-to-html5javascript-with-emscripten-2012-04.
- ↑ Clark, Lin. "Standardizing WASI: A system interface to run WebAssembly outside the web – Mozilla Hacks - the Web developer blog". Mozilla. https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webassembly-system-interface/.
- ↑ The Wasmtime Project. "WASI: The WebAssembly System Interface". The Wasmtime Project. https://wasi.dev/.
- ↑ The Wasmtime Project. "Wasmtime: A small and efficient runtime for WebAssembly & WASI". The Wasmtime Project. https://wasmtime.dev/.
- ↑ Wasmer. "Wasmer: The Universal WebAssembly Runtime". Wasmer. https://wasmer.io/.
- ↑ "sqlite3 WebAssembly & JavaScript Documentation Index". https://sqlite.org/wasm.
- ↑ http://www.meshlabjs.net - Homepage of the experimental, client based, javascript, version of MeshLab that runs inside a browser
- ↑ "Porting Examples and Demos". https://github.com/emscripten-core/emscripten/wiki/Porting-Examples-and-Demos.
- ↑ "The Future of AutoCAD". http://through-the-interface.typepad.com/through_the_interface/2018/03/the-future-of-autocad.html..
- ↑ 13.0 13.1 "Qt for WebAssembly". https://doc.qt.io/qt-5/wasm.html.
- ↑ "Unity game engine heading to the browser without plug-ins". 18 March 2014. https://arstechnica.com/gadgets/2014/03/unity-game-engine-heading-to-the-browser-without-plug-ins/.
- ↑ "The future of scripting in Unity – Unity Blog". http://blogs.unity3d.com/2014/05/20/the-future-of-scripting-in-unity/.
- ↑ "Defold HTML Development". https://defold.com/manuals/html5/.
- ↑ "Developing HTML5 with Unreal". 18 December 2023. https://docs.unrealengine.com/4.26/en-US/SharingAndReleasing/HTML5/GettingStarted/#:~:text=The%20Unreal%20Engine%204%20(UE4,UE4%27s%20C%2B%2B%20code%20into%20Javascript.
- ↑ "openFrameworks setup for Emscripten". http://openframeworks.cc/setup/emscripten/.
- ↑ Ohlheiser, Abby (2015-01-05). "You can now play nearly 2,400 MS-DOS video games in your browser". The Washington Post. https://www.washingtonpost.com/blogs/the-switch/wp/2015/01/05/you-can-now-play-nearly-2400-ms-dos-video-games-in-your-browser/.
- ↑ Each New Boot a Miracle by Jason Scott (December 23, 2014)
- ↑ "Internet Archive Search: "collection:softwarelibrary_msdos"". https://archive.org/search.php?query=collection%3Asoftwarelibrary_msdos&page=1.
External links
- Project page on GitHub
- Emscripten Documentation
- Porting Examples and Demos
- A list of some WebAssembly runtimes
Original source: https://en.wikipedia.org/wiki/Emscripten.
Read more |