Just this past week, I was happy to announce that I finally completed something I’d been working on since November of last year – A WebAssembly Video Course. It was challenging for sure – I had played around with WebAssembly, but this was the first time that I was building a course from scratch and then recording it. You learn so much about a technology by teaching it, and I got to explore new depths of WebAssembly throughout this course. I’d like to share some of my thoughts of the WebAssembly/C++ ecosystem.
Getting Started With WebAssembly/C++
Bonus points for Emscripten tests as well. Tests should act as documentation (but not your only kind), especially for examples. Emscripten gave so many different tests that I could load on my own and play with. It gave a safe space to experiment, which is crucial to playing with new technologies.
Go look at https://emscripten.org and https://webassembly.org. In my opinion, their documentation is fantastic in explaining things succinctly, and providing solid examples in the code. I hate poor documentation, and it’s beyond frustrating learning a new technology when things aren’t clear/don’t work.
Case in point, one time I was learning Forth, and trying to figure out file I/O. I found some documentation, and copy pasted it into my editor, and it wouldn’t even compile. I’m sure I was doing something wrong, but I had no idea what, and it left a bad taste in my mouth.
Going through the WebAssembly and Emscripten docs, on the other hand, were pleasant, and I actively enjoyed browsing different topics, which is a big win for explorability of your tool.
The web ecosystem for debugging/profiling/tracing is superb, there’s no denying that. There’s a wealth of tools that most people don’t even know about built right into your web browser (memory snapshotting, network tracing, cpu profiling, storage introspection, etc.). These were all incredible features, but in the context of WebAssembly, they have a little bit more to grow. In order to effectively inspect variables, I had to look at both Firefox and Chrome simultaneously. It will get there, it just feels a bit immature at the moment.
Advanced C++ Features
Graphics and Audio
This isn’t a dig on WebAssembly, but the state of graphics and audio in C++. I do not find graphics/audio programming to be accessible. Emscripten documentation recommends using SDL, or OpenGL, or OpenAL, and while these are super powerful, they are not beginner friendly. I could see this being especially frustrating for someone building their own games or simulations without a strong background in these technologies. I feel like these libraries are so performance-intensive (and to some degree, they need to be to run the heavy hitters), that they sacrifice usability. I’d like to see more examples in the community that use simplified APIs and paradigms, even if it does cost some performance. You have to be able to build something and learn about it first, and then you can worry about optimization.
So those are my thoughts. Agree/Disagree? Let me know in the comments below. Feel free to share what you’ve liked/disliked about the WebAssembly ecosystem as well.