Modern C++ Techniques for Legacy Code: An Emulator Case Study | ACCU 2025 Keynote

Added:

Speaker's Journey
Hardware Basics
First Emulator
Early Success
Modern Approach
Template Tricks
Module Test
Co-routines Use
Web Port
Final Thoughts

Speaker's Journey

0:04
Playing Section
  • 1

    Speaker recounts childhood introduction to computing via ZX Spectrum.

  • 2

    Plans to write a Z80 emulator twice: old-style and modern C++.

  • 3

    Sets up keynote goal to challenge personal coding assumptions.

Fundamental understanding of C++11/14 features such as move semantics, smart pointers, and basic templates.
Basic concepts of computer architecture and emulation, including registers, memory mapping, and instruction cycles (specifically regarding 8-bit CPUs like the Z80).
Familiarity with compile-time evaluation concepts, specifically the basic usage of the 'constexpr' keyword.
Understanding the differences between legacy C-style programming (manual memory management, raw pointers) and idiomatic C++.
Advanced C++ Coroutines: Implementing custom coroutine types, promise objects, and awaitables for asynchronous systems.
C++20 Modules Migration: Practical strategies for refactoring large legacy headers into modular, scalable translation units.
Compile-time Metaprogramming: Utilizing 'consteval', 'constinit', and template metaprogramming to perform complex computations and validation at compile time.
Micro-architectural Performance Profiling: Analyzing compiler output (e.g., via Compiler Explorer) and assembly to verify that modern abstractions yield zero-overhead machine code.
25.1K views864likes1:20:45@ACCUConfOriginal Release: 2025-08-29

This keynote demonstrates how modern C++ features like templates, modules, and coroutines can be applied to traditional systems programming tasks, such as implementing a ZX Spectrum emulator. The presenter, an experienced C++ developer who initially resisted modern language features, shows that while these features can improve code quality and maintainability, they also present challenges including increased build times and steeper learning curves. The key takeaway is that learning new programming paradigms, even for experienced developers, is essential for professional growth and can lead to more elegant and maintainable code solutions.