Emscripten: Difference between revisions
replaced Unreal Engine#Unreal Engine 3|Unreal Engine 3 with Unreal Engine 3 |
|||
(20 intermediate revisions by 19 users not shown) | |||
Line 11: | Line 11: | ||
| released = <!-- {{Start date|YYYY|MM|DD|df=yes}} --> |
| released = <!-- {{Start date|YYYY|MM|DD|df=yes}} --> |
||
| discontinued = |
| discontinued = |
||
| latest release version = {{wikidata|property|preferred|references|edit|P348|P548=Q2804309}} | latest release date = {{Start date and age|{{wikidata|qualifier|preferred|single|P348|P548=Q2804309|P577}}|df=yes}} |
|||
| latest release version = 2.0.29 |
|||
| latest release date = {{Start date and age|2021|08|26|df=yes}}<ref>{{cite web|title=emscripten-core/emscripten: Releases|url=https://github.com/emscripten-core/emscripten/releases|department=emscripten-core/emscripten|website=[[GitHub]]|access-date=2021-02-09}}</ref> |
|||
| latest preview version = |
| latest preview version = |
||
| latest preview date = <!-- {{Start date and age|YYYY|MM|DD|df=yes}} --> |
| latest preview date = <!-- {{Start date and age|YYYY|MM|DD|df=yes}} --> |
||
Line 24: | Line 23: | ||
| alexa = |
| alexa = |
||
}} |
}} |
||
'''Emscripten''' is an [[LLVM]]/[[Clang]]-based [[compiler]] that compiles [[C (programming language)|C]] and [[C++]] [[source code]] to [[WebAssembly]]<ref>[https://github.com/kripken/emscripten/wiki/WebAssembly WebAssembly · emscripten-core/emscripten Wiki · GitHub<!-- Bot generated title -->]</ref> |
'''Emscripten''' is an [[LLVM]]/[[Clang]]-based [[compiler]] that compiles [[C (programming language)|C]] and [[C++]] [[source code]] to [[WebAssembly]],<ref>[https://github.com/kripken/emscripten/wiki/WebAssembly WebAssembly · emscripten-core/emscripten Wiki · GitHub<!-- Bot generated title -->]</ref> 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 [[interpreter (computing)|interpreted]] or [[just-in-time compilation|dynamically compiled]] JavaScript. With the more recent development of the WebAssembly System Interface (WASI)<ref>{{cite web|url=https://wasi.dev/|title=WASI: The WebAssembly System Interface|author=The Wasmtime Project|website=WASI.dev|publisher=The Wasmtime Project|access-date=2021-02-10}}</ref> and WebAssembly [[runtime system|runtimes]] such as [[Node.js]], Wasmtime,<ref>{{cite web|url=https://wasmtime.dev/|title=Wasmtime: A small and efficient runtime for WebAssembly & WASI|author=The Wasmtime Project|website=Wasmtime.dev|publisher=The Wasmtime Project|access-date=2021-02-10}}</ref> and Wasmer,<ref>{{cite web|url=https://wasmer.io/|title=Wasmer: The Universal WebAssembly Runtime|author=Wasmer|website=Wasmer.io|publisher=Wasmer|access-date=2021-02-10}}</ref> Emscripten can also be used to compile to WebAssembly for execution in non-Web embeddings as well. |
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 [[interpreter (computing)|interpreted]] or [[just-in-time compilation|dynamically compiled]] JavaScript. It even emulates an entire [[POSIX]] operating system, enabling programmers to use functions from the [[C standard library]] (libc).<ref name="ClarkL_(2019)">{{cite web |last1=Clark |first1=Lin |title=Standardizing WASI: A system interface to run WebAssembly outside the web – Mozilla Hacks - the Web developer blog |url=https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webassembly-system-interface/ |website=Mozilla Hacks – the Web developer blog |publisher=Mozilla |access-date=31 October 2022}}</ref> |
||
With the more recent development of the WebAssembly System Interface (WASI)<ref>{{cite web|url=https://wasi.dev/|title=WASI: The WebAssembly System Interface|author=The Wasmtime Project|website=WASI.dev|publisher=The Wasmtime Project|access-date=2021-02-10}}</ref> and WebAssembly [[runtime system|runtimes]] such as [[Node.js]], Wasmtime,<ref>{{cite web|url=https://wasmtime.dev/|title=Wasmtime: A small and efficient runtime for WebAssembly & WASI|author=The Wasmtime Project|website=Wasmtime.dev|publisher=The Wasmtime Project|access-date=2021-02-10}}</ref> and Wasmer,<ref>{{cite web|url=https://wasmer.io/|title=Wasmer: The Universal WebAssembly Runtime|author=Wasmer|website=Wasmer.io|publisher=Wasmer|access-date=2021-02-10}}</ref> Emscripten can also be used to compile to WebAssembly for execution in non-Web embeddings as well. |
|||
== Usage == |
== Usage == |
||
Emscripten has been used to [[porting|port]] a number of C/C++ code bases to WebAssembly, including [[ |
Emscripten has been used to [[porting|port]] a number of C/C++ code bases to WebAssembly, including [[Unreal Engine 3]], [[SQLite]],<ref>{{Cite web |
||
| url = https://sqlite.org/wasm |
|||
| title = sqlite3 WebAssembly & JavaScript Documentation Index |
|||
| website = SQLite |
|||
| access-date = 2023-05-08 |
|||
}}</ref> [[MeshLab]],<ref>http://www.meshlabjs.net - Homepage of the experimental, client based, javascript, version of [[MeshLab]] that runs inside a browser</ref> [[Bullet (software)|Bullet physics]],<ref>{{Cite web |
|||
| url = https://github.com/emscripten-core/emscripten/wiki/Porting-Examples-and-Demos |
| url = https://github.com/emscripten-core/emscripten/wiki/Porting-Examples-and-Demos |
||
| title = Porting Examples and Demos |
| title = Porting Examples and Demos |
||
Line 39: | Line 45: | ||
| website = Through the Interface |
| website = Through the Interface |
||
| access-date = 2018-05-09 |
| access-date = 2018-05-09 |
||
}}.</ref> and a subset of the [[Qt (software)|Qt application framework]].<ref name=":0">{{Cite web|url=https://doc.qt.io/qt-5/wasm.html|title=Qt for WebAssembly}}</ref> |
}}.</ref> and a subset of the [[Qt (software)|Qt application framework]].<ref name=":0">{{Cite web|url=https://doc.qt.io/qt-5/wasm.html|title=Qt for WebAssembly}}</ref> Other examples of software ported to WebAssembly via Emscripten include the following: |
||
=== Game engines === |
=== Game engines === |
||
The [[Unity (game engine)|Unity]], [[ |
The [[Unity (game engine)|Unity]], [[Defold]], and [[Godot (game engine)|Godot]] game engines provide an export option to HTML5, utilizing Emscripten.<ref>{{Cite web |
||
| url = https://arstechnica.com/gadgets/2014/03/unity-game-engine-heading-to-the-browser-without-plug-ins/ |
| url = https://arstechnica.com/gadgets/2014/03/unity-game-engine-heading-to-the-browser-without-plug-ins/ |
||
| title = Unity game engine heading to the browser without plug-ins |
| title = Unity game engine heading to the browser without plug-ins |
||
| website = Ars Technica |
| website = Ars Technica |
||
| date = 18 March 2014 |
|||
| access-date = 2016-03-01 |
| access-date = 2016-03-01 |
||
}}</ref><ref>{{Cite web |
}}</ref><ref>{{Cite web |
||
Line 53: | Line 60: | ||
| access-date = 2016-03-01 |
| access-date = 2016-03-01 |
||
}}</ref><ref>{{Cite web |
}}</ref><ref>{{Cite web |
||
| url = https:// |
| url = https://defold.com/manuals/html5/ |
||
| title = |
| title = Defold HTML Development |
||
| website = |
| website = Defold Documentation |
||
| access-date = |
| access-date = 2023-12-18 |
||
}}</ref> |
|||
[[Unreal Engine]] had this export option but it has been migrated out of the engine to a community member plug in.<ref>{{Cite web |
|||
| url = 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 |
|||
| title = Developing HTML5 with Unreal |
|||
| website = Unreal Documentation |
|||
| date = 18 December 2023 |
|||
| access-date = 2018-12-18 |
|||
}}</ref> |
}}</ref> |
||
Line 68: | Line 82: | ||
=== Software archiving === |
=== 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.<ref>{{cite |
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.<ref>{{cite news|url=https://www.washingtonpost.com/blogs/the-switch/wp/2015/01/05/you-can-now-play-nearly-2400-ms-dos-video-games-in-your-browser/ |title=You can now play nearly 2,400 MS-DOS video games in your browser |first=Abby |last=Ohlheiser |date=2015-01-05 |access-date=2015-01-08 |newspaper=[[The Washington Post]]}}</ref><ref>[http://ascii.textfiles.com/archives/4471 Each New Boot a Miracle] by Jason Scott (December 23, 2014)</ref><ref>{{Cite web |
||
| url = https://archive.org/search.php?query=collection%3Asoftwarelibrary_msdos&page=1 |
| url = https://archive.org/search.php?query=collection%3Asoftwarelibrary_msdos&page=1 |
||
| title = Internet Archive Search: "collection:softwarelibrary_msdos" |
| title = Internet Archive Search: "collection:softwarelibrary_msdos" |
||
Line 79: | Line 93: | ||
* [[asm.js]] |
* [[asm.js]] |
||
* [[Google Native Client]] (PNaCl) |
* [[Google Native Client]] (PNaCl) |
||
* [[Haxe]] |
|||
* [[WebAssembly]] |
* [[WebAssembly]] |
||
Latest revision as of 20:47, 21 July 2024
Original author(s) | Alon Zakai |
---|---|
Stable release | 3.1.72[1]
/ 18 November 2024 |
Repository | |
Written in | C, C++, JavaScript[2] |
Type | Compiler |
License | MIT License, University of Illinois/NCSA Open Source License |
Website | emscripten |
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]- asm.js
- Google Native Client (PNaCl)
- WebAssembly
References
[edit]- ^ "Release 3.1.72". 18 November 2024. Retrieved 22 November 2024.
- ^ "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. Retrieved 31 October 2022.
- ^ The Wasmtime Project. "WASI: The WebAssembly System Interface". WASI.dev. The Wasmtime Project. Retrieved 2021-02-10.
- ^ The Wasmtime Project. "Wasmtime: A small and efficient runtime for WebAssembly & WASI". Wasmtime.dev. The Wasmtime Project. Retrieved 2021-02-10.
- ^ Wasmer. "Wasmer: The Universal WebAssembly Runtime". Wasmer.io. Wasmer. Retrieved 2021-02-10.
- ^ "sqlite3 WebAssembly & JavaScript Documentation Index". SQLite. Retrieved 2023-05-08.
- ^ http://www.meshlabjs.net - Homepage of the experimental, client based, javascript, version of MeshLab that runs inside a browser
- ^ "Porting Examples and Demos". Emscripten GitHub wiki. Retrieved 2016-03-01.
- ^ "The Future of AutoCAD". Through the Interface. Retrieved 2018-05-09..
- ^ a b "Qt for WebAssembly".
- ^ "Unity game engine heading to the browser without plug-ins". Ars Technica. 18 March 2014. Retrieved 2016-03-01.
- ^ "The future of scripting in Unity – Unity Blog". Unity Technologies Blog. Retrieved 2016-03-01.
- ^ "Defold HTML Development". Defold Documentation. Retrieved 2023-12-18.
- ^ "Developing HTML5 with Unreal". Unreal Documentation. 18 December 2023. Retrieved 2018-12-18.
- ^ "openFrameworks setup for Emscripten". openFrameworks. Retrieved 2016-03-04.
- ^ 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.
- ^ Each New Boot a Miracle by Jason Scott (December 23, 2014)
- ^ "Internet Archive Search: "collection:softwarelibrary_msdos"". archive.org. Retrieved 2016-03-01.