<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: uecker</title><link>https://news.ycombinator.com/user?id=uecker</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Sun, 21 Jun 2026 14:59:39 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=uecker" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by uecker in "Show HN: Microcrad – Micrograd Reimplemented in C"]]></title><description><![CDATA[
<p>Reserved identifiers in general are not only for future use of the standard, but also for internal use of implementations and for extensions.  The single-under bar rule is to give the programmer some part of the _... namespace which is otherwise reserved for the implementation. I.e. for use in macros, variables, or struct members. The intention is for use in hidden names in some API.</p>
]]></description><pubDate>Sun, 21 Jun 2026 08:38:27 +0000</pubDate><link>https://news.ycombinator.com/item?id=48616885</link><dc:creator>uecker</dc:creator><comments>https://news.ycombinator.com/item?id=48616885</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48616885</guid></item><item><title><![CDATA[New comment by uecker in "Show HN: Microcrad – Micrograd Reimplemented in C"]]></title><description><![CDATA[
<p>In C, you would typically rely much more on tooling to find bugs (but there are different styles and opinions). Checking for null is not bad, but does not usually add anything. If you de-reference a null pointer, you get a segmentation fault (which is safe) and a debugger will give a nice backtrace. So why catch this by writing additional code if the right tool will give you this automatically? A sanitizer could also add such tests automatically.<p>For a similar reason, it makes sense to use signed integers. A signed overflow sanitizer will find the overflow bugs or safely terminate the program. Finding unsigned wraparound bugs is much harder.</p>
]]></description><pubDate>Sat, 20 Jun 2026 21:07:04 +0000</pubDate><link>https://news.ycombinator.com/item?id=48612991</link><dc:creator>uecker</dc:creator><comments>https://news.ycombinator.com/item?id=48612991</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48612991</guid></item><item><title><![CDATA[New comment by uecker in "Show HN: Microcrad – Micrograd Reimplemented in C"]]></title><description><![CDATA[
<p>Also reserved as identifier with file scope, just not for "any use". In any case, the program used underbar + capital letter.</p>
]]></description><pubDate>Sat, 20 Jun 2026 20:11:01 +0000</pubDate><link>https://news.ycombinator.com/item?id=48612567</link><dc:creator>uecker</dc:creator><comments>https://news.ycombinator.com/item?id=48612567</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48612567</guid></item><item><title><![CDATA[New comment by uecker in "Show HN: Microcrad – Micrograd Reimplemented in C"]]></title><description><![CDATA[
<p>Two things stick out as un-idiomatic for C. First, the casts before malloc are unnecessary. This you do in C++ but not in C. Second, names with beginning underscore are reserved, and the underscore + capital letter is specifically problematic.<p>The rest looks fairly nice but there are a couple of things I would do differently: I would not have the tests for NULL, but use signed integers for indices and dimensions, use a flexible array member to integrate the data into the vector type directly, and omit the capacity field (as long as benchmarking does not show it is really needed). I would also use variably modified types for bounds checking, and with C23 the include guards become largely unnecessary.<p>(edit: minor edit for clarity)</p>
]]></description><pubDate>Sat, 20 Jun 2026 19:12:05 +0000</pubDate><link>https://news.ycombinator.com/item?id=48612037</link><dc:creator>uecker</dc:creator><comments>https://news.ycombinator.com/item?id=48612037</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48612037</guid></item><item><title><![CDATA[New comment by uecker in "How memory safety CVEs differ between Rust and C/C++"]]></title><description><![CDATA[
<p>By complexity I mean roughly the number of language rules / techniques / idioms a programmer has to understand and keep in their head to be able to program effectively. I would say this is far lower in C than in Rust. I do not see how the additional hoops Rust makes you jump through makes it easier to achieve a goal, but I see how it can help prevent certain errors (but not many others).<p>It also seems obvious that the problematic aspect of getting anything done in Rust is fully compensated by having a lot of libraries available quickly via Cargo, so people are essentially just assembling things at a high-level. And in principle, I think this is a very good thing, but in the way this is implemented it comes with severe supply chain risks.</p>
]]></description><pubDate>Fri, 19 Jun 2026 05:02:58 +0000</pubDate><link>https://news.ycombinator.com/item?id=48594942</link><dc:creator>uecker</dc:creator><comments>https://news.ycombinator.com/item?id=48594942</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48594942</guid></item><item><title><![CDATA[New comment by uecker in "How memory safety CVEs differ between Rust and C/C++"]]></title><description><![CDATA[
<p>The check can not be removed if it becomes before the access because in this case the program <i>has no UB</i>.<p>If there were UB, a compiler in C is not allowed to move (time-travel) UB before any observable behavior. This was never allowed by in C (int contrast to C++), but the wording was not clear, which we fixed in C23.<p>If there is no check, you are right that the access itself is UB and there is no requirement to trap in ISO C, but this is something compilers explicitly support.
(and it might be required by POSIX, but I am not sure)</p>
]]></description><pubDate>Thu, 18 Jun 2026 04:46:55 +0000</pubDate><link>https://news.ycombinator.com/item?id=48580932</link><dc:creator>uecker</dc:creator><comments>https://news.ycombinator.com/item?id=48580932</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48580932</guid></item><item><title><![CDATA[New comment by uecker in "How memory safety CVEs differ between Rust and C/C++"]]></title><description><![CDATA[
<p>I did not know this was disputed, as even developer surveys in the Rust community highlighted complexity as a concern. But seems it is the overall summary of features that make it complex: lifetime, borrowing, a polymorphic type system, traits, multiple tools to manage lifetimes, macros, proc macros, async, unsafe, panic, unwrap, etc.  But I agree it is much cleaner than C++.</p>
]]></description><pubDate>Wed, 17 Jun 2026 05:24:30 +0000</pubDate><link>https://news.ycombinator.com/item?id=48566063</link><dc:creator>uecker</dc:creator><comments>https://news.ycombinator.com/item?id=48566063</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48566063</guid></item><item><title><![CDATA[New comment by uecker in "How memory safety CVEs differ between Rust and C/C++"]]></title><description><![CDATA[
<p>I guess this depends on what you might corrupt (if it is not valuable but irrelevant intermediate state it might be ok) and what the consequences of an outage are.<p>In any case, I largely tend to agree with you that this is better in most scenarios (not for the cloudflare incident though).   But a segfault in C for a null pointer dereference would have exactly the same result, which is why null pointer dereferences are a terribly example if you want to show the advantages of Rust.<p>The only example I know where I think Rust clearly has a real advantage are lifetimes.</p>
]]></description><pubDate>Tue, 16 Jun 2026 16:03:50 +0000</pubDate><link>https://news.ycombinator.com/item?id=48557392</link><dc:creator>uecker</dc:creator><comments>https://news.ycombinator.com/item?id=48557392</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48557392</guid></item><item><title><![CDATA[New comment by uecker in "How memory safety CVEs differ between Rust and C/C++"]]></title><description><![CDATA[
<p>Considering the amount of C programs that exist, the "we see severe bugs in C code seemingly every week" is on the same level of propaganda as we see "crime in the news every week" when the real societal problems are entirely different.</p>
]]></description><pubDate>Tue, 16 Jun 2026 15:51:53 +0000</pubDate><link>https://news.ycombinator.com/item?id=48557209</link><dc:creator>uecker</dc:creator><comments>https://news.ycombinator.com/item?id=48557209</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48557209</guid></item><item><title><![CDATA[New comment by uecker in "How memory safety CVEs differ between Rust and C/C++"]]></title><description><![CDATA[
<p>There are certainly good parts in Rust that force you deal with inherent issues explicitly.  I do not think this justifies a language with the complexity of Rust, but I would agree it is preferable to C++ in this regard.</p>
]]></description><pubDate>Tue, 16 Jun 2026 15:20:51 +0000</pubDate><link>https://news.ycombinator.com/item?id=48556661</link><dc:creator>uecker</dc:creator><comments>https://news.ycombinator.com/item?id=48556661</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48556661</guid></item><item><title><![CDATA[New comment by uecker in "How memory safety CVEs differ between Rust and C/C++"]]></title><description><![CDATA[
<p>A major global internet outage can certainly considered a "clear signal". Still not sure this was a good thing though.</p>
]]></description><pubDate>Tue, 16 Jun 2026 15:12:31 +0000</pubDate><link>https://news.ycombinator.com/item?id=48556525</link><dc:creator>uecker</dc:creator><comments>https://news.ycombinator.com/item?id=48556525</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48556525</guid></item><item><title><![CDATA[New comment by uecker in "How memory safety CVEs differ between Rust and C/C++"]]></title><description><![CDATA[
<p>The check is removed only if you already dereference the pointer <i>before</i> doing the check. But then, you also get the trap before the check. So the compiler eliding the check is not making this worse - as long as the zero page is not mapped.<p>In any case, you can also configure GCC to not do this, and you can also configure it to insert explicit null checks before dereferencing a pointer. So C can offer you security and reproducibility (in this aspect).</p>
]]></description><pubDate>Tue, 16 Jun 2026 15:08:25 +0000</pubDate><link>https://news.ycombinator.com/item?id=48556466</link><dc:creator>uecker</dc:creator><comments>https://news.ycombinator.com/item?id=48556466</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48556466</guid></item><item><title><![CDATA[New comment by uecker in "How memory safety CVEs differ between Rust and C/C++"]]></title><description><![CDATA[
<p>Do you have any evidence for this? On GCC it should be safe.<p>(EDIT: what is not safe is indexing into a null pointer. For this you need to be safe you need -fsanitize=null)</p>
]]></description><pubDate>Tue, 16 Jun 2026 05:14:13 +0000</pubDate><link>https://news.ycombinator.com/item?id=48550884</link><dc:creator>uecker</dc:creator><comments>https://news.ycombinator.com/item?id=48550884</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48550884</guid></item><item><title><![CDATA[New comment by uecker in "How memory safety CVEs differ between Rust and C/C++"]]></title><description><![CDATA[
<p>There can be made very good arguments why C is less safe than Rust, but null pointer dereferences which are perfectly safe everywhere except on weird platforms  (and usually could be made safe even there by turning on a compiler flag) seems a very misleading argument.<p>And as as the Cloudflare incident showed, a Rust unwrap can have equally bad consequences. (or as Ariane 5 showed, a safe overflow in Ada can have explosive consequences)</p>
]]></description><pubDate>Tue, 16 Jun 2026 05:04:35 +0000</pubDate><link>https://news.ycombinator.com/item?id=48550828</link><dc:creator>uecker</dc:creator><comments>https://news.ycombinator.com/item?id=48550828</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48550828</guid></item><item><title><![CDATA[New comment by uecker in "How memory safety CVEs differ between Rust and C/C++"]]></title><description><![CDATA[
<p>While it is undefined behavior on the C standard level it a null pointer dereference is guaranteed to trap on most platforms.</p>
]]></description><pubDate>Tue, 16 Jun 2026 05:00:18 +0000</pubDate><link>https://news.ycombinator.com/item?id=48550794</link><dc:creator>uecker</dc:creator><comments>https://news.ycombinator.com/item?id=48550794</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48550794</guid></item><item><title><![CDATA[New comment by uecker in "How memory safety CVEs differ between Rust and C/C++"]]></title><description><![CDATA[
<p>You need to turn it off by defining NDEBUG. While sometimes it is not for release builds, I am not sure this is common.</p>
]]></description><pubDate>Tue, 16 Jun 2026 04:57:39 +0000</pubDate><link>https://news.ycombinator.com/item?id=48550774</link><dc:creator>uecker</dc:creator><comments>https://news.ycombinator.com/item?id=48550774</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48550774</guid></item><item><title><![CDATA[New comment by uecker in "How memory safety CVEs differ between Rust and C/C++"]]></title><description><![CDATA[
<p>The kernel is perhaps bit special.  In the past they had bugs such as first derferencing and then checking for null and weird possibilities to map the zero page. But today I am not convinced this is really needed.<p>In general on a system where you trap when accessing the zero page, this optimization should be safe and a null pointer dereferences should (safely) trap.</p>
]]></description><pubDate>Tue, 16 Jun 2026 04:56:03 +0000</pubDate><link>https://news.ycombinator.com/item?id=48550761</link><dc:creator>uecker</dc:creator><comments>https://news.ycombinator.com/item?id=48550761</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48550761</guid></item><item><title><![CDATA[New comment by uecker in "Orthodox C++ (2016)"]]></title><description><![CDATA[
<p>The license is indeed the big reason for many proprietary forks (not so much that llvm is written in C++). This is not a good thing though.</p>
]]></description><pubDate>Sun, 14 Jun 2026 08:07:51 +0000</pubDate><link>https://news.ycombinator.com/item?id=48525209</link><dc:creator>uecker</dc:creator><comments>https://news.ycombinator.com/item?id=48525209</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48525209</guid></item><item><title><![CDATA[New comment by uecker in "Orthodox C++ (2016)"]]></title><description><![CDATA[
<p>The question is whether GCC is a good example of the benefits of C++ for compilers. Considering the code looks to 95% like C code and uses data structures that we originally implemented in C, I don't see this argument.</p>
]]></description><pubDate>Sun, 14 Jun 2026 07:45:20 +0000</pubDate><link>https://news.ycombinator.com/item?id=48525086</link><dc:creator>uecker</dc:creator><comments>https://news.ycombinator.com/item?id=48525086</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48525086</guid></item><item><title><![CDATA[New comment by uecker in "Orthodox C++ (2016)"]]></title><description><![CDATA[
<p>There is a difference between "needing a library" and "implement my own". One can just pick one. And even when implementing things yourself, one has to do this just once.</p>
]]></description><pubDate>Sun, 14 Jun 2026 07:37:18 +0000</pubDate><link>https://news.ycombinator.com/item?id=48525041</link><dc:creator>uecker</dc:creator><comments>https://news.ycombinator.com/item?id=48525041</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48525041</guid></item></channel></rss>