Emscripten
![]() | |
Original author(s) | Alon Zakai |
---|---|
Stable release | 3.1.64[1] ![]() |
Repository | |
Written in | C,C++,JavaScript[2] |
Type | Compiler |
License | MIT License,University of Illinois/NCSA Open Source License |
Website | emscripten![]() |
Emscriptenis anLLVM/Clang-basedcompilerthat compilesCandC++source codetoWebAssembly,[3]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 thaninterpretedordynamically compiledJavaScript. It even emulates an entirePOSIXoperating system, enabling programmers to use functions from theC standard library(libc).[4]
With the more recent development of the WebAssembly System Interface (WASI)[5]and WebAssemblyruntimessuch asNode.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 toporta number of C/C++ code bases to WebAssembly, includingUnreal Engine 3,SQLite,[8]MeshLab,[9]Bullet physics,[10]AutoCAD,[11]and a subset of theQt application framework.[12]Other examples of software ported to WebAssembly via Emscripten include the following:
Game engines
[edit]TheUnity,Defold,andGodotgame engines provide an export option to HTML5, utilizing Emscripten.[13][14][15] Unreal Enginehad this export option but it has been migrated out of the engine to a community member plug in.[16]
Frameworks & toolkits
[edit]openFrameworksexports native C++ applications to HTML5 via Emscripten.[17]emscripten-qt permits compiling applications written using theQt application frameworkto WebAssembly.[12]
Software archiving
[edit]In December 2014, theInternet Archivelaunched aDOSBoxemulator compiled in Emscripten to provide browser-based access to thousands of archivedMS-DOSand PC programs.[18][19][20]
See also
[edit]References
[edit]- ^"Release 3.1.64".18 July 2024.Retrieved22 August2024.
- ^"emscripten-core/emscripten: Emscripten: An LLVM-to-JavaScript Compiler".GitHub.
C: 40.0%; C++: 34.4%; JavaScript: 17.4%.
- ^WebAssembly · emscripten-core/emscripten Wiki · GitHub
- ^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.Retrieved31 October2022.
- ^The Wasmtime Project."WASI: The WebAssembly System Interface".WASI.dev.The Wasmtime Project.Retrieved2021-02-10.
- ^The Wasmtime Project."Wasmtime: A small and efficient runtime for WebAssembly & WASI".Wasmtime.dev.The Wasmtime Project.Retrieved2021-02-10.
- ^Wasmer."Wasmer: The Universal WebAssembly Runtime".Wasmer.io.Wasmer.Retrieved2021-02-10.
- ^"sqlite3 WebAssembly & JavaScript Documentation Index".SQLite.Retrieved2023-05-08.
- ^http:// meshlabjs.net- Homepage of the experimental, client based, javascript, version ofMeshLabthat runs inside a browser
- ^"Porting Examples and Demos".Emscripten GitHub wiki.Retrieved2016-03-01.
- ^"The Future of AutoCAD".Through the Interface.Retrieved2018-05-09..
- ^ab"Qt for WebAssembly".
- ^"Unity game engine heading to the browser without plug-ins".Ars Technica.18 March 2014.Retrieved2016-03-01.
- ^"The future of scripting in Unity – Unity Blog".Unity Technologies Blog.Retrieved2016-03-01.
- ^"Defold HTML Development".Defold Documentation.Retrieved2023-12-18.
- ^"Developing HTML5 with Unreal".Unreal Documentation.18 December 2023.Retrieved2018-12-18.
- ^"openFrameworks setup for Emscripten".openFrameworks.Retrieved2016-03-04.
- ^Ohlheiser, Abby (2015-01-05)."You can now play nearly 2,400 MS-DOS video games in your browser".The Washington Post.Retrieved2015-01-08.
- ^Each New Boot a Miracleby Jason Scott (December 23, 2014)
- ^"Internet Archive Search:" collection:softwarelibrary_msdos "".archive.org.Retrieved2016-03-01.