Rethinking C++ Coroutines: A Punk Rock Approach
Explore unconventional C++ coroutines with Ivan Čukić's rebellious take on breaking programming norms.
Written by AI. Dev Kapoor

Rethinking C++ Coroutines: A Punk Rock Approach
Ivan Čukić's recent talk at Meeting C++ 2025, cheekily titled "(Don't) use coroutines for this," encourages a rebellious reexamination of coroutines in C++. In a field where structured concurrency and asynchronous execution often dominate discussions, Čukić presents a vision of coroutines as a versatile flow control feature, akin to loops and functions, that can simplify code well beyond their conventional usage.
Coroutines Beyond Concurrency
Čukić opens with a playful admission, "I'm now in a rebellious state," setting the stage for what he dubs "punk rock C++." His approach is to challenge the norms and explore coroutines' potential beyond their typical application in concurrency. He suggests, "Coroutines are just another flow control language feature," emphasizing the need to rethink their role within C++.
A central theme in Čukić's talk is the idea of stackless recursion. Traditional recursion can lead to stack overflow, a limitation Čukić seeks to overcome by implementing coroutines in a way that avoids the stack. He describes this as "going against the rule but without breaking any rules," a nod to the punk ethos of subverting the status quo.
Disabling Optimizations: A Double-Edged Sword
Čukić explains that compiler optimizations often undermine the stackless nature of coroutines. By disabling these optimizations, particularly the "Halo"—Heap Allocation Illusion Optimization—programmers can maintain stackless behavior. However, this approach complicates implementation and may not be advisable for production code. Čukić humorously warns, "You should not do this," underscoring the experimental nature of his suggestions.
Quote Highlights
- "The only thing that we've done so far is just to forbid every single part of the coroutine to end up on the stack."
- "If we created stackless coroutines and disabled the thing that doesn’t make them stackless, then we should be fine. Nope."
- "Coroutines are a mechanism to redefine how parts of the C++ abstract machine works."
Debugging and Logging
One of the practical applications Čukić advocates is enhancing debugging through meticulous logging. By leveraging coroutines to hook into function call events, developers can create detailed logs that capture the flow of execution. This can provide invaluable insights, especially when dealing with complex recursive calls.
Balancing Creativity and Best Practices
The talk is peppered with humor and cautionary tales about the pitfalls of straying too far from best practices. Čukić acknowledges the allure of innovative solutions but stresses the importance of a balanced approach, where creativity does not compromise code reliability. His rebellious stance is both a critique of rigid programming conventions and a call to explore the boundaries of C++.
The Bigger Picture
Čukić's exploration reflects broader tensions in the programming world. As developers, we are often caught between adhering to established norms and venturing into uncharted territory. This talk serves as a reminder that questioning conventions can lead to novel insights, but also that these insights must be tempered with pragmatism.
Coroutines Without the Corporate Gloss
Ivan Čukić's punk rock take on C++ coroutines invites developers to rethink their assumptions and explore the full potential of the language's features. While his methods may not be suitable for every project, they highlight the importance of understanding the underlying mechanics of execution. In an industry that sometimes feels as rigid as the code it produces, Čukić's rebellious spirit is a refreshing call to innovate and challenge the norms.
More Like This
Dozzle: The Docker Log Viewer That Does Less (On Purpose)
Dozzle is a 7MB tool that streams Docker logs to your browser. No storage, no database, no complexity. Better Stack shows why that's the point.
Pencil.dev Brings Free Design-to-Code Canvas to Claude
Pencil.dev's new desktop app connects design and code through Claude's MCP integration, offering a free alternative to Figma for AI-assisted frontend development.
C++ Safety: Balancing Performance and Security
Explore C++ safety issues and modern programming practices to enhance security without compromising performance.
Musk's Digital Optimus: AGI Vision Meets Project Chaos
Elon Musk announces Digital Optimus AI to automate office work, but leaked reports reveal the project collapsed at xAI. What's really happening?
Browser Use CLI Gives AI Agents Web Control—For Free
New Browser Use CLI tool lets AI agents control browsers with plain English commands. Free, fast, and works with Claude Code—but raises questions about automation.
Thinking Machines Launches Inkling, Its First Open-Weight AI Model
Mira Murati's Thinking Machines has released Inkling, an open-weight multimodal AI model built on DeepSeek's architecture—and the implications go well beyond benchmarks.
35 GitHub Projects Mapping the AI Agent Trust Gap
This week's GitHub trending list is less a catalog of tools and more a collective argument: developers don't fully trust AI agents yet—and they're building accordingly.