CppCon 2018: Hana Dusíková “Compile Time Regular Expressions”
CppCon1 HN recommender · recommended in 1 month, 2020–2025
talk · advanced · evergreen · 2020–2025 on HN
Hana Dusikova's CppCon 2018 talk presenting a C++ library that builds regular expressions from compile-time strings, using a C++20 feature. It avoids runtime parsing cost and covers implementation details, problems she hit, and benchmarks.
Pointed to as the canonical presentation of compile-time regex in C++ and its template metaprogramming, including benchmark results.
Up next
11 mo on HNCppCon 2015: Andrei Alexandrescu “std::allocator...”
CppCon
7 HN recommender · 2017–2025
12 mo on HNLexical Scanning in Go - Rob Pike
GoogleFOSSSydney
13 HN recommender · 2012–2025
10 mo on HNCppCon 2017: Matt Kulukundis “Designing a Fast, Efficient, Cache-friendly Hash Table, Step by Step”
CppCon
9 HN recommender · 2018–2026
9 mo on HNRustConf 2018 - Closing Keynote - Using Rust For Game Development by Catherine West
Rust Programming Language
9 HN recommender · 2018–2023
10 mo on HNCppCon 2016: Jason Turner “Rich Code for Tiny Computers: A Simple Commodore 64 Game in C++17”
CppCon
13 HN recommender · 2016–2024
9 mo on HNIdeas about a new programming language for games.
Jonathan Blow
7 HN recommender · 2014–2025
9 mo on HNCppCon 2014: Mike Acton "Data-Oriented Design and C++"
CppCon
9 HN recommender · 2015–2026
9 mo on HNHow I program C
Eskil Steenberg
8 HN recommender · 2017–2025
9 mo on HNGoogle I/O 2012 - Go Concurrency Patterns
Google for Developers
9 HN recommender · 2012–2025
7 mo on HNCppCon 2015: Kate Gregory “Stop Teaching C"
CppCon
7 HN recommender · 2016–2025
7 mo on HNZig: A programming language designed for robustness, optimality, and clarity – Andrew Kelley
Recurse Center
6 HN recommender · 2018–2024
7 mo on HNCppCon 2014: Chandler Carruth "Efficiency with Algorithms, Performance with Data Structures"
CppCon
7 HN recommender · 2014–2024
3 comments from Hacker News
FYI: This is a C++ template version of compile time regex class. A 54:47 presentation at CppCon 2018 is worth more than a thousand words... see ▶ this video followup CppCon 2019 video at link As the above github repo mentions, more info at link
One of the stated benefits is that the compiler optimizer can optimize the regex state machine that gets created, resulting in significantly faster match times at runtime. There are some benchmarks if you look up her cppcon talk about the library iirc. Edit: here is her talk, at 39 minutes she shares the benchmarks. ▶ this video
> Passing strings into a templates ... wouldn't work in C++ ... ▶ this video Here's an example of parsing regular expressions in C++ at compile time. Code here: link