Top all-time · #78
John Regehr
Personal blog · blog.regehr.orgprogrammingsystems
John Regehr writes Embedded in Academia, a personal blog at blog.regehr.org about programming and systems. Since 2010, 404 different Hacker News readers have linked it 867 times, most often “A Guide to Undefined Behavior in C and C++ (2010)”. The last post was in 2024, but the archive is still widely read.
Sometimes recommended · 7 of 40 sampled comments recommend it?
Why HN links it
HN readers link John Regehr's blog for its deep dives into undefined behavior in C, compiler optimization, and static analysis. It is often recommended as the place to learn C properly and is cited in debates about C versus Rust.
- Recommended for · 7 comments
- One commenter calls it essential reading for learning C; another says the author really understands C; another calls one post a favourite; another recommends it
Summarised by Claude from a sample of 40 HN comments that link here. Each comment is marked recommending, critical or neutral (citing without judging); how this works.
Most-linked posts?
- A Guide to Undefined Behavior in C and C++ (2010)30 people · 41 mentions · first linked 2017-08-01
- A Guide to Undefined Behavior in C and C++ (2010)25 people · 26 mentions · first linked 2010-07-09
- The Problem with Friendly C15 people · 21 mentions · first linked 2017-09-24
- Race Condition vs. Data Race (2011)13 people · 14 mentions · first linked 2017-11-15
- Proposal for a Friendly Dialect of C11 people · 16 mentions · first linked 2014-08-27
- Operant Conditioning by Software Bugs (2012)11 people · 13 mentions · first linked 2018-04-08
- C Compilers Disprove Fermat’s Last Theorem (2010)11 people · 12 mentions · first linked 2017-09-22
- We Need Hardware Traps for Integer Overflow11 people · 12 mentions · first linked 2014-05-28
- Does Google Knol encourage and profit from plagiarism?10 people · 14 mentions · first linked 2010-07-07
- Undefined Behavior in 20179 people · 14 mentions · first linked 2017-07-05
What Hacker News says?
No one else has mentioned what I think are his two greatest insights besides the Singularity: * A Deepness in the Sky depicts a human interstellar civilization thousands of years in the future, in which superluminal travel is impossible (for the humans), so travelers use hibernation to pass the decades while their ships travel between systems. Merchants, including the ones the book portrays, often revisit systems af…
Comment linking /archives/255
on “Vernor Vinge has died”Submitted A Tourist’s Guide to the LLVM Source Code as a story · 489 points
HN discussionI'd recommend "Embedded in Academia" - https://blog.regehr.org/
Comment linking /
on “Ask HN: What are some good technology blogs to follow?”Submitted Teaching C as a story · 368 points
HN discussionhttp://blog.regehr.org http://blog.llvm.org/
Comment linking /
on “Ask HN: What are some good technology blogs to follow?”Submitted Fun at the Unix Terminal as a story · 279 points
HN discussionIt makes sense that large corporations would be interested in Rust given its current capabilities and future potential. Amazon, Huawei, Google, Microsoft, and Mozilla all have a vested interest in Rust succeeding since they are all deeply invested in high performance software, the majority of which is written in C and C++. The undefined behavior semantics in C and C++ trade safe handling of undefined behavior for hi…
Comment linking /archives/213
on “Rust Foundation: Hello, World”Submitted The Little C Function From Hell as a story · 273 points
HN discussionWhat do you think of a variant on this? https://blog.regehr.org/archives/1180
Comment linking /archives/1180
on “Tell HN: C Experts Panel – Ask us anything about C”Submitted How LLVM Optimizes a Function as a story · 268 points
HN discussionAny plans to add semantics for exceptional situations such as divide by zero and dereferencing a null pointer? https://blog.regehr.org/archives/232 Or incorporating features from this 14 item list? https://blog.regehr.org/archives/1180 As it appears these have failed: https://blog.regehr.org/archives/1287
Comment linking /archives/1287
on “Tell HN: C Experts Panel – Ask us anything about C”Submitted Teaching C (2016) as a story · 263 points
HN discussionCover topics around software development, math, programming languages, and academia: http://stuffwithstuff.com/ https://ericlippert.com/ http://thume.ca/archive.html https://medium.com/@mdwdotla https://faculty.washington.edu/ajko/posts https://computinged.wordpress.com/ https://blog.acolyer.org/ https://blog.sigplan.org/blog/ https://blog.paranoidcoding.com/ https://blog.regehr.org/ https://eli.thegreenplace.net/ h…
Comment linking /
on “Ask HN: Favorite Blogs by Individuals?”Submitted Explaining Code Using ASCII Art as a story · 232 points
HN discussionApparently Mozilla, Microsoft, Google, IBM and all companies slowly moving their system infrastructure to Rust don't know enough C. >Unless you're being wildly negligent and reckless with your programming, C is really not that scary https://blog.regehr.org/archives/970
Comment linking /archives/970
on “Moving the Linux Kernel to Modern C”Submitted Xv6 as a story · 222 points
HN discussionWhy is this necessarily true? All Rust gives you is safety -- no data races and better memory safety. But since data races and use-after-free are undefined behavior in C++ anyway, C++ compilers can still aggressively optimize by assuming those two don't happen. It's true that some compilers disable optimizations on certain undefined behavior to prevent unintuitive behavior ( https://blog.regehr.org/archives/140 ) bu…
Comment linking /archives/140
on “Brave Improves Its Ad-Blocker Performance with New Engine in Rust”Submitted Proposal for a Friendly Dialect of C as a story · 218 points
HN discussionDeWitt clauses have spread outside of databases too, unfortunately. John Regehr got a nastygram from Coverity/Synopsys when he tried to post static analyzer benchmarks (not even his own; the benchmarks were done by researchers at the Toyota InfoTechnology Center): https://blog.regehr.org/archives/1217 This has effectively dissuaded me from trying to perform benchmarks of Coverity and other commercial tools using LAV…
Comment linking /archives/1217
on “Larry Ellison allegedly tried to have a professor fired for benchmarking Oracle”Submitted Explaining Code Using ASCII Art as a story · 209 points
HN discussionThere have been attempts over the years. See here, a decade ago: https://blog.regehr.org/archives/1287 > eventually I came to the depressing conclusion that there’s no way to get a group of C experts — even if they are knowledgable, intelligent, and otherwise reasonable — to agree on the Friendly C dialect. There are just too many variations, each with its own set of performance tradeoffs, for consensus to be possib…
Comment linking /archives/1287
on “Matt Godbolt sold me on Rust by showing me C++”Submitted Compiler Optimizations are Awesome as a story · 203 points
HN discussionMore precisely, Rust saves you from data races but not race conditions. https://blog.regehr.org/archives/490
Comment linking /archives/490
on “Fearless Concurrency in Firefox Quantum”Submitted The Declining Value of a CS Master's Degree (2013) as a story · 199 points
HN discussionI was struggling to come up with "worth it" ASCII-art-in-code scenarios for my codebase and found a post[1] with examples (that turns out to have been posted here in HN a while back[2]). Pretty cool. [1] https://blog.regehr.org/archives/1653 [2] https://news.ycombinator.com/item?id=31891226
Comment linking /archives/1653
on “Monodraw”Submitted A Quiz About Integers in C as a story · 197 points
HN discussionI think Nuno Lopes also did some work on proving the correctness of instcombine optimizations, for instance: http://blog.regehr.org/archives/1170
Comment linking /archives/1170
on “GodBolt: Enter C, get Assembly”Submitted Teaching C (2016) as a story · 195 points
HN discussion> Under WebAssembly's memory model, dereferencing NULL=0 won't lead to a segfault. Thanks that's a curious one. It won't always lead to a segfault with a conventional compiler either, undefined behaviour being what it is. [0][1] Fortunately GCC can be asked to add such checks at runtime, [2] this approach could also be taken with WebAssembly. [0] https://devblogs.microsoft.com/oldnewthing/20140627-00/?p=63... [1] ht…
Comment linking /archives/213
on “Cosmopolitan Libc: build-once run-anywhere C library”Submitted Teaching C (2016) as a story · 186 points
HN discussion