Emscripten
Emscriptenは、CおよびC++ソースコードを、主にウェブブラウザ上で実行することを目的として、WebAssembly[3](または、2017年にWebAssemblyが登場するまで当初のターゲットであった、asm.jsとして知られるJavaScriptのサブセット[4])にコンパイルする、LLVM/Clangベースのコンパイラ。
| 開発元 | Alon Zakai |
|---|---|
| 初版 | 2012年11月11日 |
| 最新版 |
3.1.44
/ 2023年7月25日[1] |
| リポジトリ | |
| プログラミング 言語 | C, C++, JavaScript[2] |
| 種別 | コンパイラ |
| ライセンス | MITライセンス, イリノイ大学/NCSAオープンソースライセンス |
| 公式サイト |
emscripten |
Emscriptenを利用することで、CまたはC++で書かれたアプリケーションやライブラリを事前コンパイルして、ウェブブラウザ上で効率的に、特に動的にコンパイルされたあるいはインタプリタ実行されたJavaScriptと同等か、より速いスピードで実行することが可能になる。さらに最新のWebAssembly System Interface(WASI)[5]の開発成果物とNode.js、Wasmtime[6]、Wasmer[7]などのWebAssemblyランタイムと組み合わせると、Emscriptenは非Web環境で実行するためのWebAssembly埋め込み用にコンパイルすることもできる。
利用
EmscriptenはC/C++コードベースをWebAssemblyに移植するために広く利用されており、代表例としてUnreal Engine 3、SQLite、MeshLab[8]、Bullet physics[9]、AutoCAD[10]、Qt アプリケーションフレームワークのサブセット[11]がある。Emscriptenを利用してWebAssemblyに移植されたソフトウェアの他の例としては、以下が挙げられる。
フレームワークとツールキット
openFrameworksはEmscriptenを利用してネイティブC++アプリケーションをHTML5にエクスポートできる[15]。emscripten-qtはQtアプリケーションフレームワークを使用して書かれたアプリケーションをWebAssemblyにコンパイルすることを可能にする[11]。
参考
- asm.js
- Google Native Client(PNaCl)
- Haxe
- WebAssembly
参照
- Releases · emscripten-core/emscripten
- emscripten-core/emscripten: Emscripten: An LLVM-to-WebAssembly Compiler. "C 46.8%; C++ 37.1%; JavaScript 10.8%"
- “Building to WebAssembly — Emscripten 2.0.31 (dev) documentation”. emscripten.org. 2021年9月17日閲覧。
- Walton, Zach (2012年4月4日). “Easily Port C++ To HTML5/JavaScript With Emscripten”. WebProNews. iEntry Network. 2013年8月17日閲覧。
- The Wasmtime Project. “WASI: The WebAssembly System Interface”. WASI.dev. The Wasmtime Project. 2021年2月10日閲覧。
- The Wasmtime Project. “Wasmtime: A small and efficient runtime for WebAssembly & WASI”. Wasmtime.dev. The Wasmtime Project. 2021年2月10日閲覧。
- Wasmer. “Wasmer: The Universal WebAssembly Runtime”. Wasmer.io. Wasmer. 2021年2月10日閲覧。
- 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. 2016年3月1日閲覧。
- “The Future of AutoCAD”. Through the Interface. 2018年5月9日閲覧。.
- “Qt for WebAssembly”. 2020年9月25日閲覧。
- “Unity game engine heading to the browser without plug-ins”. Ars Technica. 2016年3月1日閲覧。
- “The future of scripting in Unity – Unity Blog”. Unity Technologies Blog. 2016年3月1日閲覧。
- “Tappy Chicken”. www.unrealengine.com. 2016年3月1日閲覧。
- “openFrameworks setup for Emscripten”. openFrameworks. 2016年3月4日閲覧。
- Ohlheiser, Abby (2015年1月5日). “You can now play nearly 2,400 MS-DOS video games in your browser”. The Washington Post. 2015年1月8日閲覧。
- Each New Boot a Miracle by Jason Scott (December 23, 2014)
- “Internet Archive Search: "collection:softwarelibrary_msdos"”. archive.org. 2016年3月1日閲覧。