How to Implement Your First Compiler Feature:The Story of Concepts in Clang
summary
Implements C++20 Concepts in Clang end-to-end: parses concept definitions, adds AST nodes, wires requires clauses, abbreviated templates and the new requires expression into parsing and semantic checking, and drives overload resolution and diagnostics to match the standard. Before that a tooling detour collapses gigantic diagnostics (a reported 1.2 GB of errors), a temporary static_print hack is added to GCC for compile-time debugging. Work spans about a month of initial hacking and ~18 months to reach feature-complete per C++20 and begin merging into mainline.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 4:46About the speaker
- 7:14GCC concepts struggles
- 14:40Adding static print to GCC
- 25:56Deciding to implement concepts
- 28:49First steps in Clang
- 37:15Compiler design principles
- 41:22Planning the implementation
- 46:04Requires expressions challenge
- 47:34Finalizing the feature
- 50:09Key takeaways
- 52:37Q&A
related talks
01h 07mConcepts As She Is Spoke
01h 39m“Concepts: The Future of Generic Programming (the future is here)”
01h 11mConcepts in 60: Everything you need to know and nothing you don't
54mC++ Concepts for Developers
59mMetaprogramming: From Templates to Concepts
01h 27mC++20 Templates - the Next Level: Concepts and More
52mConcepts: The Future of Generic Programming
01h 28mC++ Concepts "Lite" in Practice
