Mode:
Duration:
1
2
3
4
5
6
7
# emscripten/demo/add.c
#include <emscripten/emscripten.h>
EMSCRIPTEN_KEEPALIVE
int add(int a, int b) {
return a + b;
}Coding works best on desktop or with an external keyboard.
# emscripten/demo/add.c
#include <emscripten/emscripten.h>
EMSCRIPTEN_KEEPALIVE
int add(int a, int b) {
return a + b;
}Coding works best on desktop or with an external keyboard.
A basic C function that adds two numbers and returns the result, compiled with Emscripten.
# emscripten/demo/add.c
#include <emscripten/emscripten.h>
EMSCRIPTEN_KEEPALIVE
int add(int a, int b) {
return a + b;
}Emscripten is an open-source compiler toolchain that compiles C and C++ code into WebAssembly (Wasm) or asm.js, allowing developers to run native code in web browsers at near-native speed.
Origin & Creator
Emscripten was originally developed by Alon Zakai in 2010 and is now maintained as an open-source project under the LLVM and WebAssembly ecosystems.
Industrial Note
Emscripten is ideal for developers porting legacy C/C++ applications to the web, including games, scientific simulations, multimedia apps, and performance-critical software.