Skip to content
HomeVideos
AllLongsCategoriesPlaylists
BooksBlogsPodcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K

    CppCon 2016: Chandler Carruth “Garbage In, Garbage Out: Arguing about Undefined Behavior..."

    CppCon

    4 HN recommenders · recommended in 13 months, 2016–2026

    YouTube

    57:39 · 94K views · Oct 6, 2016

    Chandler Carruth's CppCon 2016 talk tries to defuse the heated debate over undefined behavior in C and C++. He explains from the compiler writer's perspective why UB exists and how it enables optimization.

    HN points to it whenever undefined behavior comes up, as the best explanation of the reasoning behind UB, though some dispute its framing.

    Software Engineering & LanguagesC, C++, Rust, Go & systems languagesCompilers, interpreters & program analysisSoftware performance & optimization
    1. 59:34
      CppCon 2017: Matt Kulukundis “Designing a Fast, Efficient, Cache-friendly Hash Table, Step by Step”CppCon137K views • 9 years ago
    2. 1:29:54
      CppCon 2015: Chandler Carruth "Tuning C++: Benchmarks, and CPUs, and Compilers! Oh My!"CppCon188K views • 11 years ago
    3. 1:13:41
      CppCon 2014: Chandler Carruth "Efficiency with Algorithms, Performance with Data Structures"CppCon235K views • 12 years ago
    4. 59:53
      CppCon 2019: Chandler Carruth “There Are No Zero-cost Abstractions”CppCon147K views • 7 years ago
    5. 1:39:25
      CppCon 2016: Herb Sutter “Leak-Freedom in C++... By Default.”CppCon149K views • 10 years ago
    6. 1:33:02
      2013 Keynote: Chandler Carruth: Optimizing the Emergent Structures of C++CppNow34K views • 13 years ago
    7. 55:49
      CppCon 2016: Chandler Carruth “High Performance Code 201: Hybrid Data Structures"CppCon119K views • 10 years ago
    8. 1:15:46
      CppCon 2017: Matt Godbolt “What Has My Compiler Done for Me Lately? Unbolting the Compiler's Lid”CppCon178K views • 9 years ago
    9. 1:29:06
      CppCon 2015: Herb Sutter "Writing Good C++14... By Default"CppCon193K views • 11 years ago
    10. 1:19:52
      CppCon 2016: Jason Turner “Rich Code for Tiny Computers: A Simple Commodore 64 Game in C++17”CppCon264K views • 10 years ago
    11. 1:00:58
      CppCon 2017: Chandler Carruth “Going Nowhere Faster”CppCon113K views • 9 years ago
    12. 1:36:27
      CppCon 2016: Dan Saks “extern c: Talking to C Programmers about C++”CppCon175K views • 10 years ago
    13. 1:27:46
      CppCon 2014: Mike Acton "Data-Oriented Design and C++"CppCon863K views • 12 years ago
    14. 1:24:36
      C++ Exceptions for Smaller Firmware - Khalil Estell - CppCon 2024CppCon23K views • 1 year ago
    15. 1:14:22
      CppCon 2017: Fedor Pikus “C++ atomics, from basic to advanced. What do they really do?”CppCon289K views • 9 years ago
    16. 52:01
      CppCon 2017: Louis Brandy “Curiously Recurring C++ Bugs at Facebook”CppCon158K views • 9 years ago
    17. 1:54:00
      Can C++ be 10x Simpler & Safer? - Herb Sutter - CppCon 2022CppCon277K views • 3 years ago
    18. 1:12:27
      CppCon 2015: Andrei Alexandrescu “std::allocator...”CppCon196K views • 11 years ago
    19. 1:00:07
      CppCon 2017: Carl Cook “When a Microsecond Is an Eternity: High Performance Trading Systems in C++”CppCon358K views • 9 years ago
    20. 1:04:33
      CppCon 2014: Jeff Preshing "How Ubisoft Develops Games for Multicore - Before and After C++11"CppCon53K views • 12 years ago

    14 comments from Hacker News

    1. @moefhAug 2023· in “A Guide to Undefined Behavior in C and C++”

      One man's "broken code produced by the compiler" is another man's "excellently optimized code by the compiler". Where to draw the line is not always clear, but here's a very clear-cut example[1] where emitting a warning would be bad. If you don't want to watch the video, it's basically this: - the code technically contains undefined behavior, but it will never be actually triggered by the program - changing the code to remove undefined behavior forces the compiler to emit terrible code Making the compiler yell at the programmer in this case would be terrible, but it's clearly a consequence of what you're asking. [1] this video

      RecommendsView on HN
    2. @JokyNov 2018· in “Trip report: Fall ISO C++ standards meeting”

      Actually I discourage my colleague to use unsigned especially because they can overflow. The problem with overflow is that most of the time it is a program bug if there is an overflow that wasn't intended. Using signed arithmetic means that you can actually trap on overflow and catch these bugs (using fuzzing for instance). Chandler explained it nicely in his CPPCon 2016 talk "Garbage In, Garbage Out: Arguing about Undefined Behavior...". I encourage to watch the full talk but here is one relevant example: this video And here he mentions how Google experimented with this internally: this video

      RecommendsView on HN
    3. @kllrnohjMar 2018· in “A Usable C++ Dialect That Is Safe Against Memory Corruption”

      The generally recommended thing for catching & fixing this is: [LINK] CppCon has also had a lot of great talks on UB and why it is what it is, such as this video

      RecommendsView on HN
    4. @lyricaljokeMay 2018· in “Depressing and faintly terrifying days for the C standard [pdf]”

      Chandler Carruth's talk on the subject was really useful for my own understanding of the reasoning behind UB: this video

      RecommendsView on HN
    5. @atiedebeeFeb 2026· in “What every compiler writer should know about programmers (Anton Ertl, 2015) [pdf]”

      ISO C99 actually defines multiple types of deviating behaviour. What you're describing is closer to implementation-defined behaviour than anything else. The three behaviours relevant in this discussion, from section 3.4: 3.4.1 implementation-defined behavior unspecified behavior where each implementation documents how the choice is made EXAMPLE An example of implementation-defined behavior is the propagation of the high-order bit when a signed integer is shifted right. 3.4.3 undefined behavior behavior, upon use of a nonportable or erroneous program construct or of erroneous data, for which this International Standard imposes no requirements Possible undefined behavior ranges from ignoring the situation completely with unpredictable results, to behaving during translation or program execution in a documented manner characteristic of the environment (with or without the issuance of a diagnostic message), to terminating a translation or execution (with the issuance of a diagnostic message). An example of undefined behavior is the behavior on integer overflow. 3.4.4 unspecified behavior behavior where this International Standard provides two or more possibilities and imposes no further requirements on which is chosen in any instance An example of unspecified behavior is the order in which the arguments to a function are evaluated. K&R seems to also mention "undefined" and "implementation-defined" behaviour on several occasions. It doesn't specify what is meant by undefined behav

      CitesView on HN