Bringing a Mobile C++ Codebase to the Web
summary
Claim: adding full WebAssembly support to Djinni lets the same interface definitions expose existing C++ to JavaScript/TypeScript with almost no C++ changes. Implementation uses WebAssembly and embind for primitive and object marshalling, generates TypeScript bindings for static checks, uses FinalizationRegistry to free C++ objects automatically, and preserves object identity across the boundary. Result: a large mobile C++ codebase powers Snapchat for Desktop Web, and the extension is available on GitHub.
AI-written summary · about
chapters (15)
- 0:00Start
- 0:24Snapchat for Desktop web
- 1:51A Brief History of Djinni at Snap
- 3:55Compare to the alternatives
- 5:16TypeScript Interface Output
- 5:56Better Support for C++ Containers
- 7:30Asynchronous Methods
- 8:21Building Web Apps with Djinni
- 10:15Djinni Primitive Types
- 10:57Djinni Composite Types
- 18:58Crossing the WebAssembly/Javascript boundary
- 21:31Automatic Memory Management
- 22:43Retaining Object Identity
- 25:27Exception Handling
- 26:07Limitations
related talks
32mC++ Everywhere with WebAssembly
39mBringing the power of C++ to the web
26mWebAssembly as cross-platform architecture?!
30mWebAssembly as cross-platform architecture?!
28mWebAssembly: Of Portability, and Performance
30mBeyond Web-Apps: React, JavaScript and WebAssembly To Port Legacy Native Apps
35mWebAssembly: now web is a new compiler target architecture
30mNative Web Apps: React, JS & WebAssembly to rewrite native apps
