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.