Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Emscripten - compile your C/C++ to javascript
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
thekk
November 03, 2015
Technology
65
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Emscripten - compile your C/C++ to javascript
Just like magic, but in technology way.
thekk
November 03, 2015
More Decks by thekk
See All by thekk
i3 tiling window manager
thekk
0
150
做遊戲,從SDL開始
thekk
0
360
版本控制&Git
thekk
0
90
GC project outline slider
thekk
0
69
Other Decks in Technology
See All in Technology
NDIでApple Vision Proにリアルタイム映像送信
jyouryuusui
0
120
Code for Security プロジェクト紹介 2026年10月
yu23ki14
0
110
しろおびから始める!ログ活用の第一歩
shumei_ito
0
950
Gemini Intelligence 入門 ― AppFunctions と Gemini Nano
takuroabe
0
250
Running Kotlin + Quarkus with Lambda
nealle
1
3.7k
今さら理解するウェブフォントver.2026
takanorip
3
810
パッチ更新でterraform initが落ちた日
grimoh
1
140
hackers_champloo_2026_tidb
makocchi
0
160
20261017福岡devIO 「AIは"良いダッシュボード"を作れるか?
jtakeda
0
150
実践! SRE × AI - ABEMA における AIOps -
tetsuya28
8
3.1k
PHPカンファレンス関西の招待状 / Invitation to PHP Conference Kansai
ykanoh
0
120
"優秀な誰か"の下位互換にならないために
yut0naga1_fa
1
1.8k
Featured
See All Featured
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.9k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
300
Building Applications with DynamoDB
mza
96
7.2k
How to Ace a Technical Interview
jacobian
280
24k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
710
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
750
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
How Software Deployment tools have changed in the past 20 years
geshan
2
35k
Transcript
Emscripten Compile your C/C++ code to javascript Actually, it's from
LLVM bitcode to javascript KK – Ying Reui Liang 2015/10/XX
What is Emscripten
It's a source to source compiler bases on LLVM Compile
your C/C++ code into browser runnable javascript code Averagely, it's faster than handwrite code “Asm.js”
How it work
C/C++ source | clang/clang++ | V LLVM IR code |
Fastcomp (LLVM backend) | v Javascript code
em++ helloworld.cpp -c -o helloworld.bc
em++ helloworld.bc -o helloworld.html
Running in terminal Running in browser
Why
Large web applications Multi platform Performance critical library
Demonstration
Debugging
The native way Like we always do The browser way
Compile your codebase with -gX (X is 1~4) Then debug them on the browser
With -g4 you could even set breakpoints on C++ source
code inside browser devtool!
Porting your project
Since I don't have much experience I'll only talk a
little then skip the rest of them :P
- Main loop -
- Threading -
- Files/Assets -
Porting libraries
Currently, there's mainly three ways to port a library to
javascript using Emscripten
- The first one - If you're using portable C/C++,
or the dependencies you use had already been ported Just compile it Like jsoncpp, which relies on C++ std libraries
Write corresponding javascript code for functions in that library Like
library_sdl.js - The second one -
If the library you want to port has friendly architecture
for porting Use html5.h and other headers which Emscripten provide Treat Emscripten like another platform Like part of SDL2 does - The third one -
If you want to add certain port to official repo
of Emscripten... Check these out Or you can discuss with me, I just port SDL2_ttf last month :)
End?
Welcome to special round!
Let's talk a little about WebAssembly
None
Q&A || Thanks
References
- http://kripken.github.io/emscripten-site/index.html - https://github.com/kripken/emscripten/blob/master/docs/paper.pdf - http://asmjs.org/ - https://github.com/WebAssembly/design