Clever Geek Handbook
📜 ⬆️ ⬇️

Emscripten

Emscripten - compiler LLVM - bytecode to javascript code that can be run in a web browser . [2] . LLVM bytecode can be obtained from C or C ++ source code .

Emscripten
Emscripten logo.svg
Type ofcompiler
DeveloperAlon zakai
Written onJavascript
operating system
Hardware platform
Latest version1.38.10 [1]
conditionactive
LicenseMIT License
Siteemscripten.org

The founder of the project is Alon Zakai (Alon Zakai). Distributed under the MIT license .

JavaScript developers often face challenging tasks that are often already solved, but not in the JavaScript they need, but in a completely different programming language. To rewrite dozens or even hundreds of thousands of lines of code from C / C ++ to JavaScript is a pleasure for an amateur. This does not add enthusiasm.

An additional problem of porting is related to the fact that code emulation is obviously less effective than the execution of native code. And when the speed of step-by-step simulation of the work of another processor is not enough, they have to add dynamic recompilation - automatic translation of parts of the emulated code in JavaScript. This is quite difficult, but after processing by a smart JIT compiler, the code becomes faster.

The goal of the Emscripten project development is to create a tool that would allow to execute code on the Internet regardless of the programming language in which this code is written. Emscripten allows you to compile LLVM bytecode into JavaScript code that can be executed inside a web browser using only a regular JavaScript engine , without the need for additional plug-ins. LLVM bytecode can be generated from C / C ++ source code using the llvm-gcc and clang compilers , as well as from code in another programming language for which there is an LLVM frontend. Emscripten supports the output of the SDL library output via canvas , and also provides support for OpenGL via WebGL .

Projects that were successfully rebuilt to work in the browser include the NetBSD kernel, CPython , Ruby and Lua interpreters, Poppler PDF viewer, FreeType TrueType font rendering system, H.264 video decoder, Doom games [3] and Doom 3 [4] , Unreal Engine [5] [6] , and others. [7]

Notes

  1. ↑ Release 1.38.10
  2. ↑ Walton, Zach Easily Port C ++ To HTML5 / JavaScript With Emscripten (Unreferenced) (not available link) . WebProNews . iEntry Network (April 4, 2012). The appeal date was July 30, 2018. Archived July 30, 2013.
  3. ↑ JS-DOS / GAMES / DOOM
  4. ↑ D3Wasm: a port of id Tech 4 / Doom 3 engine to WebAssembly (Unc.) .
  5. ↑ Unreal Engine
  6. ↑ Mozilla and Epic Preview Unreal Engine 4 Running in Firefox
  7. ↑ Emscripten compiler reached the possibility of its own reassembly // opennet.ru 11/13/2012
Source - https://ru.wikipedia.org/w/index.php?title=Emscripten&oldid=99387893


More articles:

  • Luca (Malta)
  • Edward, Duke of York and Albany
  • Kiriyenko, Alexandra
  • Mirny (Kostroma region)
  • Golem (computer)
  • Camara, Abubakar (French footballer)
  • Katogo
  • 2018 European Summer Sports Championship
  • Tauris
  • Breathe (Erasure Song)

All articles

Clever Geek | 2019