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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
79
GC project outline slider
thekk
0
66
Other Decks in Technology
See All in Technology
AgentCore Runtime上にAgentic Coding基盤を構築・展開する際の設計ポイントと限界点 / Design considerations and limitations when building an agentic coding platform on AgentCore Runtime
har1101
4
220
あるけみー式LTスライド作成術
alchemy1115
2
220
2026-09-18 gotanda.sre Terraformで複数環境作ったり、複数Stateに分割したりそれとTerragrunt / Terraform multi envs and multi states
masasuzu
2
450
安心して変更できるWebフロントエンドの作り方
pirosikick
5
2.7k
Claude Codeを「使うほど育つ」AI秘書にするノウハウ
minorun365
PRO
31
26k
白金鉱業Meetup Vol.25 アウトカムが二値のデータに対するCausal Impact
brainpadpr
0
220
Issue 駆動でスペシャリストの意図を届ける、AI 実装のアクセシビリティ向上
thkt
0
120
AIを活用するために決めた "やらないこと" - 価値に注目する / Not betting on AI
soudai
PRO
2
540
Snowflakeのコスト最適化を支えるアーキテクチャ設計
ktatsuya
1
1.6k
今話題のAI「Jev」って何? 宇宙最速で学ぶ会
minorun365
PRO
27
15k
ADKで始める業務改善 - AIエージェント開発時の考えと設計
harappa80
2
160
あけおめLINE 傾向とその対策
nasa9084
0
110
Featured
See All Featured
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
360
What's in a price? How to price your products and services
michaelherold
247
13k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.8k
Optimizing for Happiness
mojombo
378
71k
Marketing to machines
jonoalderson
1
5.8k
Agile that works and the tools we love
rasmusluckow
331
22k
A Tale of Four Properties
chriscoyier
163
24k
The Curse of the Amulet
leimatthew05
3
14k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.4k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
280
Ethics towards AI in product and experience design
skipperchong
2
380
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
46k
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