CppCon 2018: “Emulating the Nintendo 3DS: Generative & Declarative Programming in Action'

preview_player
Показать описание

Tony Wasserka “Emulating the Nintendo 3DS: Generative & Declarative Programming in Action"


Data de-serialization is a surprisingly common task in game console emulation (kernel interfaces, driver communication, and file IO), and to address it we usually use repetitive boilerplate code that is often nothing but error-prone and unmaintainable. How can modern C++ help?

We take a look at the interprocess communication subsystem of the Nintendo 3DS and see how generative programming tools (variadic templates, function reflection, metaprogramming) and a declarative approach give us wins in performance, maintainability, and correctness.

The takeaway of this session is a glimpse at generators, declarative interfaces, and how to use them to solve serialization-like problems with minimal effort and maximum reusability.

Tony Wasserka
Freelance Software Developer

Low-level anything: Tony is a freelancer and long-term C++ enthusiast who has worked on the console emulator projects Dolphin (GameCube/Wii), PPSSPP (PSP), and Citra (3DS) since 2010. More recently, he has worked on Vulkan graphics drivers for PowerVR graphics processors. His main interest is exploring C++'s zero-cost abstraction capabilities and applying them to create better software for resource-constrained environments.


*-----*
*-----*
Рекомендации по теме
Комментарии
Автор

Love the typed builder pattern!
The whole dsl is cool.

I can imagine the constexpr ifs in DecodeEntry and elsewhere become hard to maintain if the scale gets larger. This is classical in dispatch by type problems. I get that it's not clear how to get the same functionality easily with template specializations. But something like boost::Hana makes the relevant sfinae tricks trivial; might be something to look into.

Cookipolation
Автор

32:26 is where I gave up on this talk. The starting premise of wanting to minimize boilerplate is fine and all, but just look at this shit. It's a nightmare spawned by C++ being a very inherently ugly language combined with a fetish for nesting and templating things into the Mariana trench. I genuinely can't understand how people can look at that slide and similar and say "Yes, very elegant".

And, even with all that he still can't really escape the starting problem because he straight up admitted that if you don't know how that series of nests and template hell is structured you'll have no idea what's going on.

brothir