Emscripten

Emscripten是基於LLVM / Clang編譯器,用來将CC++源代码编译为WebAssembly [3]。在WebAssembly於2017年出現以前,JavaScript的子集asm.js曾是編譯目標 [4]

Emscripten
原作者Alon Zakai
当前版本
  • 3.1.56 (2024年3月14日;穩定版本)[1]
源代码库
编程语言CC++JavaScript[2]
类型編譯器
许可协议MITUIUC
网站emscripten.org/ 编辑维基数据

Emscripten 允许預先编译用 C 或 C++ 编写的应用程序和库以在網頁瀏覽器中運行,絕大多數的情況下運行速度與直譯(或即時編譯)的 JavaScript 相同或更快。Emscripten 甚至可以模拟整个POSIX操作系统,使程序员能够使用C標準函式庫(libc) 中的函数。 [5]

随着WebAssembly的接口(英語:,WASI)[6]运行时系统(例如Node.js、Wasmtime[7]和Wasmer[8])上的WebAssembly的開發進展,Emscripten也可编译成在網頁以外的地方使用的WebAssembly 。

用途

Emscripten 已讓许多 C/C++ 代码库順利移植到WebAssembly,包括Unreal Engine 3SQLite[9] MeshLab[10] Bulletphysical[11] AutoCAD [12]Qt 应用程序框架的子集等等。[13]通过 Emscripten 順利移植到 WebAssembly 的其他软件範例包括:

游戏引擎

UnityGodotUnreal游戏引擎利用Emscripten提供了HTML5的导出选项。 [14] [15] [16]

框架和工具包

openFrameworks 通过 Emscripten 将本机 C++ 应用程序导出成 HTML5。[17]emscripten-qt允许将使用Qt 应用程序框架编写的应用程序编译为WebAssembly。[13]

软件归档

2014年12月,互联网档案馆推出了用Emscripten编译的DOSBox模拟器,提供数千个基於瀏覽器的存档的MS-DOS和PC程序。[18] [19] [20]

參見

參考文獻

  1. . 2024年3月14日 [2024年3月22日].
  2. . GitHub. [2023-09-03]. (原始内容存档于2023-09-03). C: 40.0%; C++: 34.4%; JavaScript: 17.4%.
  3. . [2023-09-03]. (原始内容存档于2019-01-16).
  4. Walton, Zach. . WebProNews. iEntry Network. 2012-04-04 [2012-04-25]. (原始内容存档于2013-07-30).
  5. Clark, Lin. . Mozilla Hacks – the Web developer blog. Mozilla. [31 October 2022]. (原始内容存档于2022-10-30).
  6. The Wasmtime Project. . WASI.dev. The Wasmtime Project. [2021-02-10]. (原始内容存档于2022-07-05).
  7. The Wasmtime Project. . Wasmtime.dev. The Wasmtime Project. [2021-02-10]. (原始内容存档于2020-12-04).
  8. Wasmer. . Wasmer.io. Wasmer. [2021-02-10]. (原始内容存档于2021-03-02).
  9. . SQLite. [2023-05-08].
  10. http://www.meshlabjs.net 页面存档备份,存于 - Homepage of the experimental, client based, javascript, version of MeshLab that runs inside a browser
  11. . Emscripten GitHub wiki. [2016-03-01]. (原始内容存档于2023-09-03).
  12. . Through the Interface. [2018-05-09]. (原始内容存档于2023-09-03).
  13. . [2023-09-03]. (原始内容存档于2023-10-12).
  14. . Ars Technica. 18 March 2014 [2016-03-01]. (原始内容存档于2019-03-22).
  15. . Unity Technologies Blog. [2016-03-01]. (原始内容存档于2016-03-04).
  16. . www.unrealengine.com. [2016-03-01]. (原始内容存档于2017-08-21).
  17. . openFrameworks. [2016-03-04]. (原始内容存档于2023-04-19).
  18. Ohlheiser, Abby. . The Washington Post. 2015-01-05 [2015-01-08]. (原始内容存档于2015-01-07).
  19. Each New Boot a Miracle 页面存档备份,存于 by Jason Scott (December 23, 2014)
  20. . archive.org. [2016-03-01].

外部链接

This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.