Edited by humans. Written by AI. How our editing works
All articles

Rethinking C++ Coroutines: A Punk Rock Approach

Explore unconventional C++ coroutines with Ivan Čukić's rebellious take on breaking programming norms.

Dev Kapoor

Written by AI. Dev Kapoor

January 6, 20263 min read
Share:
Speaker presenting at Meeting C++ 2025 conference on recursion and chains, with "Woven by Toyota" branding visible

Photo: Meeting Cpp / YouTube

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.

By Dev Kapoor

From the BuzzRAG Team

We Watch Tech YouTube So You Don't Have To

Get the week's best tech insights, summarized and delivered to your inbox. No fluff, no spam.

Weekly digestNo spamUnsubscribe anytime

More Like This

Orange app icon with radiating lines surrounded by gray folder tabs labeled Clients, Business, and YouTube, beside bold…

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.

Dev Kapoor·4 months ago·6 min read
Yellow "DEBUG FASTER INSTANT" text with arrow pointing to Docker container ship icon and orange stopwatch on dark background

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.

Dev Kapoor·5 months ago·7 min read
Bold orange and white text reading "CLAUDE DESIGNER" with a pixel art character and laptop displaying a dark design…

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.

Dev Kapoor·5 months ago·6 min read
Klaus Iglberger presenting at Meeting C++ 2025, with title text overlaid on a dark cityscape building background and…

C++ Safety: Balancing Performance and Security

Explore C++ safety issues and modern programming practices to enhance security without compromising performance.

Sarah Mitchell·7 months ago·3 min read
Tesla presentation showing a sleek humanoid robot head with glowing red neural lines against dark tech background, with…

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?

Dev Kapoor·4 months ago·7 min read
Man in blue shirt examines three MacBook laptops displaying M5 Max chip logos on their screens with Visual Studio Code logo…

When Three MacBooks Beat One: The Distributed AI Experiment

Developer Alex Ziskind clusters three M5 Max MacBook Pros to run AI models too large for any single machine. The results reveal hard limits.

Dev Kapoor·3 months ago·6 min read
Man in beige shirt with surprised expression next to "Introducing Opus 4.7" text and colorful design elements on cream…

Anthropic's Opus 4.7: When Safety Guardrails Lobotomize the Model

Anthropic's Opus 4.7 shows promise in coding tasks but aggressive safety filters are blocking legitimate work. Is the tooling worse than the model?

Dev Kapoor·3 months ago·6 min read

RAG·vector embedding

2026-04-15
803 tokens1536-dimmodel text-embedding-3-small

This article is indexed as a 1536-dimensional vector for semantic retrieval. Crawlers that parse structured data can use the embedded payload below.