Jump to content

Emscripten

From Wikipedia, the free encyclopedia
Emscripten
Original author(s)Alon Zakai
Stable release
3.1.69[1] Edit this on Wikidata / 11 October 2024; 32 days ago (11 October 2024)
Repository
Written inC, C++, JavaScript[2]
TypeCompiler
LicenseMIT License, University of Illinois/NCSA Open Source License
Websiteemscripten.org Edit this on Wikidata

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]

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]

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]

Frameworks & toolkits

[edit]

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

Software archiving

[edit]

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.[18][19][20]

See also

[edit]

References

[edit]
  1. ^ "Release 3.1.69". 11 October 2024. Retrieved 21 October 2024.
  2. ^ "emscripten-core/emscripten: Emscripten: An LLVM-to-JavaScript Compiler". GitHub. C: 40.0%; C++: 34.4%; JavaScript: 17.4%.
  3. ^ WebAssembly · emscripten-core/emscripten Wiki · GitHub
  4. ^ Clark, Lin. "Standardizing WASI: A system interface to run WebAssembly outside the web – Mozilla Hacks - the Web developer blog". Mozilla Hacks – the Web developer blog. Mozilla. Retrieved 31 October 2022.
  5. ^ The Wasmtime Project. "WASI: The WebAssembly System Interface". WASI.dev. The Wasmtime Project. Retrieved 2021-02-10.
  6. ^ The Wasmtime Project. "Wasmtime: A small and efficient runtime for WebAssembly & WASI". Wasmtime.dev. The Wasmtime Project. Retrieved 2021-02-10.
  7. ^ Wasmer. "Wasmer: The Universal WebAssembly Runtime". Wasmer.io. Wasmer. Retrieved 2021-02-10.
  8. ^ "sqlite3 WebAssembly & JavaScript Documentation Index". SQLite. Retrieved 2023-05-08.
  9. ^ http://www.meshlabjs.net - Homepage of the experimental, client based, javascript, version of MeshLab that runs inside a browser
  10. ^ "Porting Examples and Demos". Emscripten GitHub wiki. Retrieved 2016-03-01.
  11. ^ "The Future of AutoCAD". Through the Interface. Retrieved 2018-05-09..
  12. ^ a b "Qt for WebAssembly".
  13. ^ "Unity game engine heading to the browser without plug-ins". Ars Technica. 18 March 2014. Retrieved 2016-03-01.
  14. ^ "The future of scripting in Unity – Unity Blog". Unity Technologies Blog. Retrieved 2016-03-01.
  15. ^ "Defold HTML Development". Defold Documentation. Retrieved 2023-12-18.
  16. ^ "Developing HTML5 with Unreal". Unreal Documentation. 18 December 2023. Retrieved 2018-12-18.
  17. ^ "openFrameworks setup for Emscripten". openFrameworks. Retrieved 2016-03-04.
  18. ^ Ohlheiser, Abby (2015-01-05). "You can now play nearly 2,400 MS-DOS video games in your browser". The Washington Post. Retrieved 2015-01-08.
  19. ^ Each New Boot a Miracle by Jason Scott (December 23, 2014)
  20. ^ "Internet Archive Search: "collection:softwarelibrary_msdos"". archive.org. Retrieved 2016-03-01.
[edit]