<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Hacker News: charleslmunger</title><link>https://news.ycombinator.com/user?id=charleslmunger</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Sun, 14 Jun 2026 07:10:17 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=charleslmunger" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by charleslmunger in "Everything in C is undefined behavior"]]></title><description><![CDATA[
<p>I mean... You can turn a one byte out of bounds write into code execution.<p><a href="https://daniel.haxx.se/blog/2016/10/14/a-single-byte-write-opened-a-root-execution-exploit/" rel="nofollow">https://daniel.haxx.se/blog/2016/10/14/a-single-byte-write-o...</a><p>And if you get code execution, then you by definition have "anything".</p>
]]></description><pubDate>Thu, 21 May 2026 07:52:00 +0000</pubDate><link>https://news.ycombinator.com/item?id=48219256</link><dc:creator>charleslmunger</dc:creator><comments>https://news.ycombinator.com/item?id=48219256</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48219256</guid></item><item><title><![CDATA[New comment by charleslmunger in "Everything in C is undefined behavior"]]></title><description><![CDATA[
<p>Isn't the proposal from the parent comment to define the behavior?</p>
]]></description><pubDate>Thu, 21 May 2026 07:47:05 +0000</pubDate><link>https://news.ycombinator.com/item?id=48219221</link><dc:creator>charleslmunger</dc:creator><comments>https://news.ycombinator.com/item?id=48219221</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48219221</guid></item><item><title><![CDATA[New comment by charleslmunger in "Everything in C is undefined behavior"]]></title><description><![CDATA[
<p>I got a measurable improvement from eliminating a null pointer check within the last week. Billions of devices have arm little cores, and the extra branch predictor pressure and frontend bandwidth from those instructions can be significant.<p>A standard way to eliminate those is to invoke undefined behavior if some condition is not met;<p><pre><code>    if (a == NULL) {
      __builtin_unreachable();
    }
</code></pre>
Which then allows elimination of the null check in later code, possibly after inlining some function.</p>
]]></description><pubDate>Wed, 20 May 2026 15:50:05 +0000</pubDate><link>https://news.ycombinator.com/item?id=48209736</link><dc:creator>charleslmunger</dc:creator><comments>https://news.ycombinator.com/item?id=48209736</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48209736</guid></item><item><title><![CDATA[New comment by charleslmunger in "Everything in C is undefined behavior"]]></title><description><![CDATA[
<p>Wouldn't that make a compiler that emitted bounds checks violate the standard, since it would not be emitting the actual memory operations if you deref out of bounds?</p>
]]></description><pubDate>Wed, 20 May 2026 15:41:51 +0000</pubDate><link>https://news.ycombinator.com/item?id=48209597</link><dc:creator>charleslmunger</dc:creator><comments>https://news.ycombinator.com/item?id=48209597</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48209597</guid></item><item><title><![CDATA[New comment by charleslmunger in "Everything in C is undefined behavior"]]></title><description><![CDATA[
<p>Is that really a meaningful distinction?<p>Once you are addressing arbitrary values you are firmly in the realm of "anything happening" in practice, but you've now given up optimization opportunities. As has been repeatedly demonstrated over the years, once memory safety breaks it is practically impossible to make any guarantees about program behavior.</p>
]]></description><pubDate>Wed, 20 May 2026 15:37:43 +0000</pubDate><link>https://news.ycombinator.com/item?id=48209521</link><dc:creator>charleslmunger</dc:creator><comments>https://news.ycombinator.com/item?id=48209521</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48209521</guid></item><item><title><![CDATA[New comment by charleslmunger in "HDMI 2.1 Display Stream Compression (DSC) Ready for Amdgpu Linux Driver"]]></title><description><![CDATA[
<p>The Synaptics VMM7100-based adapters only support VRR on older firmware versions with bugs.<p>The Chrontel CH7218 is the most reliable but still also suffers blackouts during VRR.<p>ParadeTech PS196 adapters advertise VRR support but their DPCD does not correctly communicate that it is supported. So even if you add the chip to the VRR PCON list in the amdgpu driver, it still won't see VRR as supported.<p>And while some of these advertise themselves as displayport 2.0, all of them only support bandwidth of 25.96gbps on the displayport side, requiring DSC for 4k 120hz 10bit color, even though they support 48gbps on the HDMI output.</p>
]]></description><pubDate>Tue, 12 May 2026 15:19:36 +0000</pubDate><link>https://news.ycombinator.com/item?id=48109611</link><dc:creator>charleslmunger</dc:creator><comments>https://news.ycombinator.com/item?id=48109611</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48109611</guid></item><item><title><![CDATA[New comment by charleslmunger in "You can beat the binary search"]]></title><description><![CDATA[
<p>Yeah arm little cores are a very different story - they aren't superscalar out of order architectures, they can dispatch up to two operations per cycle.<p>Big cores are more like that dispatching 8 or more operations per cycle, but they're also more expensive, larger, etc.</p>
]]></description><pubDate>Sat, 02 May 2026 04:11:29 +0000</pubDate><link>https://news.ycombinator.com/item?id=47983218</link><dc:creator>charleslmunger</dc:creator><comments>https://news.ycombinator.com/item?id=47983218</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47983218</guid></item><item><title><![CDATA[New comment by charleslmunger in "You can beat the binary search"]]></title><description><![CDATA[
<p>The first implementation I encountered was a linear search, starting at the last-found field. Empirically it performed better to do a binary search with early exit and branchless bounds selection, I think due to branch predictor pressure. The data representation could be changed but it's tricky, as there are other traversals that want to go in sorted order, and there are lots of places that pass just one pointer for fields. But I agree any further improvement will probably have to come from that.<p>SIMD is tricky even with SoA because there is significant latency going between the general registers and the vector units, plus arm little cores can be configured to share a vector unit with another core.</p>
]]></description><pubDate>Fri, 01 May 2026 13:45:56 +0000</pubDate><link>https://news.ycombinator.com/item?id=47974756</link><dc:creator>charleslmunger</dc:creator><comments>https://news.ycombinator.com/item?id=47974756</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47974756</guid></item><item><title><![CDATA[New comment by charleslmunger in "You can beat the binary search"]]></title><description><![CDATA[
<p>Yeah namespaces and public/private would be quite nice, but C doesn't have them, so they get hacked on via macros and prefixing. The syntax was not the hard part of working or analyzing this code, though.</p>
]]></description><pubDate>Thu, 30 Apr 2026 23:06:03 +0000</pubDate><link>https://news.ycombinator.com/item?id=47969438</link><dc:creator>charleslmunger</dc:creator><comments>https://news.ycombinator.com/item?id=47969438</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47969438</guid></item><item><title><![CDATA[New comment by charleslmunger in "You can beat the binary search"]]></title><description><![CDATA[
<p>I've spent some brainpower on binary search and have not been able to beat this:<p><a href="https://github.com/protocolbuffers/protobuf/blob/44025909eb7064a008decaa60c305bddc8757b3a/upb/mini_table/internal/message.h#L235" rel="nofollow">https://github.com/protocolbuffers/protobuf/blob/44025909eb7...</a><p>1. Check for dense list O(1)
2. Check upper bound
3. Constant trip count binary search<p>The constant trip count is great for the branch predictor, and the core loop is pretty tightly optimized for the target hardware, avoiding multiplies. Every attempt to get more clever made the loop worse and did not pay for itself. It's hard because it's an array-of-structs format with a size of 12, and mostly pretty small N.</p>
]]></description><pubDate>Thu, 30 Apr 2026 21:50:58 +0000</pubDate><link>https://news.ycombinator.com/item?id=47968689</link><dc:creator>charleslmunger</dc:creator><comments>https://news.ycombinator.com/item?id=47968689</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47968689</guid></item><item><title><![CDATA[New comment by charleslmunger in "Consequences of passing too few register parameters to a C function"]]></title><description><![CDATA[
<p>I had fun exploiting this to <i>detect</i> the falling convention used by some code at runtime - there were two different options depending on OS version; one passed a jnienv* as the first param, the other did not. So if I called it with 0, I could tell which was being used based on whether the first argument was NULL or not. Only used for specific architectures with a defined ABI that behaved this way, of course.</p>
]]></description><pubDate>Thu, 30 Apr 2026 03:38:02 +0000</pubDate><link>https://news.ycombinator.com/item?id=47957791</link><dc:creator>charleslmunger</dc:creator><comments>https://news.ycombinator.com/item?id=47957791</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47957791</guid></item><item><title><![CDATA[New comment by charleslmunger in "Firefox Has Integrated Brave's Adblock Engine"]]></title><description><![CDATA[
<p>>Maintaining both MV2 & MV3 support isn’t easily sustainable long term when you factor in the need to prioritize other features.<p>There is no feature Firefox provides that is more differentiating than ublock origin. As long as pages load and security issues are patched it is the reason to choose Firefox as a browser. What would they prioritize over it?</p>
]]></description><pubDate>Sat, 25 Apr 2026 03:25:07 +0000</pubDate><link>https://news.ycombinator.com/item?id=47898341</link><dc:creator>charleslmunger</dc:creator><comments>https://news.ycombinator.com/item?id=47898341</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47898341</guid></item><item><title><![CDATA[New comment by charleslmunger in "Kernel code removals driven by LLM-created security reports"]]></title><description><![CDATA[
<p>If you can trigger address sanitizer from input outside the program, and the program may interact with untrusted input, isn't that always worth reporting and fixing?</p>
]]></description><pubDate>Thu, 23 Apr 2026 15:37:04 +0000</pubDate><link>https://news.ycombinator.com/item?id=47877040</link><dc:creator>charleslmunger</dc:creator><comments>https://news.ycombinator.com/item?id=47877040</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47877040</guid></item><item><title><![CDATA[New comment by charleslmunger in "Vite 8.0 Is Out"]]></title><description><![CDATA[
<p>>With Kotlin/Spring Boot, compilation is annoyingly slow. That's what you get with modern languages and rich syntax.<p>This is because the kotlin compiler is not written in the way people write fast compilers. It has almost no backend to speak of (if you are targeting the jvm), and yet it can be slower at compilation than gcc and clang when optimizing.<p>Modern fast compilers follow a sort of emerging pattern where AST nodes are identified by integers, and stored in a standard traversal order in a flat array. This makes extremely efficient use of cache when performing repeated operations on the AST. The Carbon, Zig, and Jai compiler frontends are all written this way. The kotlin compiler is written in a more object oriented and functional style that involves a lot more pointer chasing and far less data-dense structures.<p>Then, if run on a non-graal environment, you also have to pay for the interpreter and JIT warmup, which for short-lived tasks represents nontrivial overhead.<p>But unlike header inclusion or templates, which are language level features that have major effects on compilation time, I don't think kotlin the language is inherently slow to compile.</p>
]]></description><pubDate>Mon, 16 Mar 2026 01:55:57 +0000</pubDate><link>https://news.ycombinator.com/item?id=47394247</link><dc:creator>charleslmunger</dc:creator><comments>https://news.ycombinator.com/item?id=47394247</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47394247</guid></item><item><title><![CDATA[New comment by charleslmunger in "In world without BlackBerry, physical keyboards on phones are making a comeback"]]></title><description><![CDATA[
<p>The default Gboard keyboard has settings for always showing the number row, or only showing it when entering a password. There is also a setting for the "suggestion strip" under "corrections & suggestions". You can also drag to resize the keyboard itself in the Gboard menu, to scale the height.<p>Now, whether your users will do that to play your game is a different story, but the options exist.</p>
]]></description><pubDate>Sun, 22 Feb 2026 23:10:01 +0000</pubDate><link>https://news.ycombinator.com/item?id=47115822</link><dc:creator>charleslmunger</dc:creator><comments>https://news.ycombinator.com/item?id=47115822</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47115822</guid></item><item><title><![CDATA[New comment by charleslmunger in "I love the work of the ArchWiki maintainers"]]></title><description><![CDATA[
<p>Not OP, but used Arch for a while in 2011, and at some point doing an update moved /bin to /usr/bin or something like that and gave me an unbootable system. This was massive inconvenience and it took me many hours to un-hose that system, and I switched to Ubuntu. The Ubuntu became terrible with snaps and other user hostile software, so I switched to PopOS, then I got frustrated with out of date software and Cosmic being incomplete, and am now on Arch with KDE.<p>Back then I used Arch because I thought it would be cool and it's what Linux wizards use. Now Arch has gotten older, I've gotten older, and now I'm using Arch again because I've become (more of a) Linux wizard.</p>
]]></description><pubDate>Sun, 15 Feb 2026 05:43:09 +0000</pubDate><link>https://news.ycombinator.com/item?id=47021350</link><dc:creator>charleslmunger</dc:creator><comments>https://news.ycombinator.com/item?id=47021350</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47021350</guid></item><item><title><![CDATA[New comment by charleslmunger in "Faster Than Dijkstra?"]]></title><description><![CDATA[
<p>You have a list of IDs, and want to make them compact for storage or transport - fast and simple way is to sort and delta encode.</p>
]]></description><pubDate>Sat, 14 Feb 2026 14:12:32 +0000</pubDate><link>https://news.ycombinator.com/item?id=47014678</link><dc:creator>charleslmunger</dc:creator><comments>https://news.ycombinator.com/item?id=47014678</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47014678</guid></item><item><title><![CDATA[New comment by charleslmunger in "C isn't a programming language anymore (2022)"]]></title><description><![CDATA[
<p>C99, but with a million macros backporting features from newer language versions and compiler extensions. Lovely features you don't get with ordinary c99:<p>free_sized<p>#embed<p>static_assert<p>Types for enum<p>Alignof, alignas, aligned_alloc<p>_Atomic</p>
]]></description><pubDate>Fri, 06 Feb 2026 01:30:26 +0000</pubDate><link>https://news.ycombinator.com/item?id=46907871</link><dc:creator>charleslmunger</dc:creator><comments>https://news.ycombinator.com/item?id=46907871</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=46907871</guid></item><item><title><![CDATA[New comment by charleslmunger in "Ask HN: Can someone make a CAS just checking last bit on x86/ARM please?"]]></title><description><![CDATA[
<p>What hardware are you running on where the cost of a relaxed 64 bit load and a branch is significant compared to a (possibly contended) cas?<p>You could always use ldset on arm for this.</p>
]]></description><pubDate>Thu, 22 Jan 2026 00:02:45 +0000</pubDate><link>https://news.ycombinator.com/item?id=46713462</link><dc:creator>charleslmunger</dc:creator><comments>https://news.ycombinator.com/item?id=46713462</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=46713462</guid></item><item><title><![CDATA[New comment by charleslmunger in "Linux is good now"]]></title><description><![CDATA[
<p>Yup this works but there's as of yet no HBR13.5 or better input so you're not getting full hdmi 2.1 equivalent. But if you don't care about 24 bits per pixel DSC then you can have an otherwise flawless 4k120hz experience.<p><a href="https://trychen.com/feature/video-bandwidth" rel="nofollow">https://trychen.com/feature/video-bandwidth</a></p>
]]></description><pubDate>Fri, 02 Jan 2026 05:10:57 +0000</pubDate><link>https://news.ycombinator.com/item?id=46461632</link><dc:creator>charleslmunger</dc:creator><comments>https://news.ycombinator.com/item?id=46461632</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=46461632</guid></item></channel></rss>