<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: david2ndaccount</title><link>https://news.ycombinator.com/user?id=david2ndaccount</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Sun, 01 Nov 2026 14:39:07 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=david2ndaccount" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by david2ndaccount in "Much Ado About None: Sentinel Values in Python"]]></title><description><![CDATA[
<p>The answer is they don't in practical code but they come up in generic code, where you want to wrap something that is already returning an optional in your optional. In languages that do support optional[optional[whatever]], if you every actually write that you know you've messed up your API.</p>
]]></description><pubDate>Sun, 01 Nov 2026 03:23:18 +0000</pubDate><link>https://news.ycombinator.com/item?id=50322438</link><dc:creator>david2ndaccount</dc:creator><comments>https://news.ycombinator.com/item?id=50322438</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50322438</guid></item><item><title><![CDATA[New comment by david2ndaccount in "Iterating Backwards in C"]]></title><description><![CDATA[
<p>I was unclear in the article, but in my defense I wrote it in a hurry on the couch after seeing the convoluted backwards loop an llm had extruded. I meant if you are actually doing something with the index variable other than indexing. Mixing signed and unsigned types, possibly of different sizes, has surprising behavior to many programmers who don’t have the “usual arithmetic conversions” memorized. If you’re working in size_t the result simplifies: everything becomes size_t. And you generally have size_t anyway as you’re using the result of sizeof or an allocation size passed to your allocation function.<p>In general I want to avoid signed types for counts and sizes as then you have to consider both boundary conditions which is easy to mess up.</p>
]]></description><pubDate>Fri, 30 Oct 2026 06:51:39 +0000</pubDate><link>https://news.ycombinator.com/item?id=50300590</link><dc:creator>david2ndaccount</dc:creator><comments>https://news.ycombinator.com/item?id=50300590</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50300590</guid></item><item><title><![CDATA[New comment by david2ndaccount in "The October inflection point for vibe game development"]]></title><description><![CDATA[
<p>Counter point: a buddy of mine who doesn’t know how to program has been vibe-coding a video game for the last month. He got very excited early on with what he thought was quick progress, but it’s been a month and he still doesn’t have anything approaching a game or even what he wants.</p>
]]></description><pubDate>Wed, 28 Oct 2026 20:29:53 +0000</pubDate><link>https://news.ycombinator.com/item?id=50280445</link><dc:creator>david2ndaccount</dc:creator><comments>https://news.ycombinator.com/item?id=50280445</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50280445</guid></item><item><title><![CDATA[New comment by david2ndaccount in "Show HN: Qwen3-4B with the AI writing tics trained out"]]></title><description><![CDATA[
<p>There’s no contradiction. Consider this thought experiment: the real range of possible outcomes is a number from 1-100, but your model is a six-sided die so it produces a number from 1-6. It is random, unpredictable and non-deterministic and yet you will get “samey” results compared to the real range of possible outcomes.</p>
]]></description><pubDate>Mon, 19 Oct 2026 17:40:43 +0000</pubDate><link>https://news.ycombinator.com/item?id=50155400</link><dc:creator>david2ndaccount</dc:creator><comments>https://news.ycombinator.com/item?id=50155400</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50155400</guid></item><item><title><![CDATA[More Fun Extending the C Preprocessor: Mutable State]]></title><description><![CDATA[
<p>Article URL: <a href="https://www.davidpriver.com/cpp-mutable-state.html">https://www.davidpriver.com/cpp-mutable-state.html</a></p>
<p>Comments URL: <a href="https://news.ycombinator.com/item?id=50153173">https://news.ycombinator.com/item?id=50153173</a></p>
<p>Points: 2</p>
<p># Comments: 0</p>
]]></description><pubDate>Mon, 19 Oct 2026 14:48:57 +0000</pubDate><link>https://www.davidpriver.com/cpp-mutable-state.html</link><dc:creator>david2ndaccount</dc:creator><comments>https://news.ycombinator.com/item?id=50153173</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50153173</guid></item><item><title><![CDATA[New comment by david2ndaccount in "Fun Extending the C Preprocessor"]]></title><description><![CDATA[
<p>Right, you can work around it with things like this, but it means you’re forcing the C compiler to parse a compound literal just to get its length, 5 times! when the preprocessor already knows the length of `__VA_ARGS__`. Such contortions when you want a little bit of info that the compiler already has are what cause your compiler times to blow up if you try to do anything sophisticated with the cpp.<p>Your version expands `sum(1, 2, 3, 4, 5, 6)` to:<p><pre><code>    sum(sizeof ((int []){0, 1, 2, 3, 4, 5, 6}) / sizeof *((int []){0, 1, 2, 3, 4, 5, 6}) - 1, ((int []){0, 1, 2, 3, 4, 5, 6}) + (sizeof ((int []){0, 1, 2, 3, 4, 5, 6}) / sizeof *((int []){0, 1, 2, 3, 4, 5, 6}) > 1))
</code></pre>
whereas with __VA_COUNT__ it is just:<p><pre><code>    sum(6, (int[]){1, 2, 3, 4, 5, 6})</code></pre></p>
]]></description><pubDate>Mon, 19 Oct 2026 07:41:07 +0000</pubDate><link>https://news.ycombinator.com/item?id=50149498</link><dc:creator>david2ndaccount</dc:creator><comments>https://news.ycombinator.com/item?id=50149498</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50149498</guid></item><item><title><![CDATA[New comment by david2ndaccount in "Fun Extending the C Preprocessor"]]></title><description><![CDATA[
<p>__map() expands its arguments, like other function-like macros.</p>
]]></description><pubDate>Mon, 19 Oct 2026 07:32:36 +0000</pubDate><link>https://news.ycombinator.com/item?id=50149450</link><dc:creator>david2ndaccount</dc:creator><comments>https://news.ycombinator.com/item?id=50149450</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50149450</guid></item><item><title><![CDATA[New comment by david2ndaccount in "Fun Extending the C Preprocessor"]]></title><description><![CDATA[
<p>We’ll get there in this series.</p>
]]></description><pubDate>Sun, 18 Oct 2026 23:27:49 +0000</pubDate><link>https://news.ycombinator.com/item?id=50146549</link><dc:creator>david2ndaccount</dc:creator><comments>https://news.ycombinator.com/item?id=50146549</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50146549</guid></item><item><title><![CDATA[New comment by david2ndaccount in "Fun Extending the C Preprocessor"]]></title><description><![CDATA[
<p>> If the compiler supports "-E", there absolutely is some equivalent of the expanded text, with (somewhat limited) whitespace info available: if you insert whitespace into between "b" and the comma in "b,", then "-E" invocation will dutifully show it. Yes, multiple spaces are collapsed into one, but their presence/absence is tracked already.<p>Whitespace is significant in the preprocessor so of course it tracks whitespace. Whitespace isn’t dropped until phase 7 when pp-tokens are converted to C tokens.<p>As I said it’s not impossible, write the patch and see if GCC accepts it.</p>
]]></description><pubDate>Sun, 18 Oct 2026 22:21:29 +0000</pubDate><link>https://news.ycombinator.com/item?id=50146089</link><dc:creator>david2ndaccount</dc:creator><comments>https://news.ycombinator.com/item?id=50146089</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50146089</guid></item><item><title><![CDATA[New comment by david2ndaccount in "Fun Extending the C Preprocessor"]]></title><description><![CDATA[
<p>During translation of source text to a C program, the source text goes through several phases. It turns raw bytes into preprocessor tokens, then preprocessor tokens get expanded into more preprocessor tokens and then preprocessor tokens get translated into C tokens, which are fed into the C parser. There is no “expanded text”, only expanded tokens. Generally this is implemented as a state machine that produces tokens on demand, so there is no expanded text. When GCC shows you that error message, it uses the recorded source location and looks it up in the original source file. This is trivial to do. Expanding just one line of the source file would either require re-invoking the preprocessor from the beginning or storing already consumed preprocessor tokens.<p>Obviously this is possible, but no one has gotten around to implementing this feature and it’s not clear you would want either solution: buffering preprocessor tokens in case you need to expand a line for an error message greatly increases memory usage and the vast majority of compilations are successful ones with no errors, slowing down the normal case. And re-invoking the preprocessor to show you one line on every error message makes error reporting slow.</p>
]]></description><pubDate>Sun, 18 Oct 2026 21:01:31 +0000</pubDate><link>https://news.ycombinator.com/item?id=50145447</link><dc:creator>david2ndaccount</dc:creator><comments>https://news.ycombinator.com/item?id=50145447</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50145447</guid></item><item><title><![CDATA[New comment by david2ndaccount in "Fun Extending the C Preprocessor"]]></title><description><![CDATA[
<p>The article shows how to implement map, but it should be a builtin</p>
]]></description><pubDate>Sat, 17 Oct 2026 14:44:35 +0000</pubDate><link>https://news.ycombinator.com/item?id=50131630</link><dc:creator>david2ndaccount</dc:creator><comments>https://news.ycombinator.com/item?id=50131630</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50131630</guid></item><item><title><![CDATA[Fun Extending the C Preprocessor]]></title><description><![CDATA[
<p>Article URL: <a href="https://www.davidpriver.com/Fun-Extending-the-C-Preprocessor.html">https://www.davidpriver.com/Fun-Extending-the-C-Preprocessor.html</a></p>
<p>Comments URL: <a href="https://news.ycombinator.com/item?id=50106792">https://news.ycombinator.com/item?id=50106792</a></p>
<p>Points: 55</p>
<p># Comments: 41</p>
]]></description><pubDate>Thu, 15 Oct 2026 17:08:26 +0000</pubDate><link>https://www.davidpriver.com/Fun-Extending-the-C-Preprocessor.html</link><dc:creator>david2ndaccount</dc:creator><comments>https://news.ycombinator.com/item?id=50106792</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50106792</guid></item><item><title><![CDATA[New comment by david2ndaccount in "Why Pendulum had to write the most cursed "+" operator in all of Python"]]></title><description><![CDATA[
<p>"In the face of ambiguity, refuse the temptation to guess."</p>
]]></description><pubDate>Wed, 07 Oct 2026 20:50:17 +0000</pubDate><link>https://news.ycombinator.com/item?id=49998619</link><dc:creator>david2ndaccount</dc:creator><comments>https://news.ycombinator.com/item?id=49998619</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49998619</guid></item><item><title><![CDATA[New comment by david2ndaccount in "Type Safe Generic Data Structures in C (2025)"]]></title><description><![CDATA[
<p>Their specification is pretty bad, allowing code like:<p><pre><code>    #include <stdio.h>
    #include <stddef.h>
    void v(int y[printf("hello world!\n")]){ 
    }

    int main(){
        v(NULL);
        typedef int wut[printf("oh no\n")];
    }
    $ cc vla.c && ./a.out
    hello world!
    oh no</code></pre>
`typedef`s with side effects...</p>
]]></description><pubDate>Mon, 05 Oct 2026 19:02:25 +0000</pubDate><link>https://news.ycombinator.com/item?id=49969005</link><dc:creator>david2ndaccount</dc:creator><comments>https://news.ycombinator.com/item?id=49969005</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49969005</guid></item><item><title><![CDATA[New comment by david2ndaccount in "Type Safe Generic Data Structures in C"]]></title><description><![CDATA[
<p>I agree. Alas I have a day job and my other hobby is going for long hikes. But when the days get shorter and the weather is worse I’ll write some more!</p>
]]></description><pubDate>Mon, 05 Oct 2026 17:46:33 +0000</pubDate><link>https://news.ycombinator.com/item?id=49968010</link><dc:creator>david2ndaccount</dc:creator><comments>https://news.ycombinator.com/item?id=49968010</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49968010</guid></item><item><title><![CDATA[New comment by david2ndaccount in "Type Safe Generic Data Structures in C (2025)"]]></title><description><![CDATA[
<p>Hey that’s me! Cool to see people like my stuff.</p>
]]></description><pubDate>Mon, 05 Oct 2026 15:42:18 +0000</pubDate><link>https://news.ycombinator.com/item?id=49966343</link><dc:creator>david2ndaccount</dc:creator><comments>https://news.ycombinator.com/item?id=49966343</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49966343</guid></item><item><title><![CDATA[New comment by david2ndaccount in "On social reality in China"]]></title><description><![CDATA[
<p>Weird to talk about these traits like Chinese cynicism and generational trauma without even mentioning the Great Leap Forward and Cultural Revolution.</p>
]]></description><pubDate>Fri, 02 Oct 2026 20:43:34 +0000</pubDate><link>https://news.ycombinator.com/item?id=49938382</link><dc:creator>david2ndaccount</dc:creator><comments>https://news.ycombinator.com/item?id=49938382</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49938382</guid></item><item><title><![CDATA[New comment by david2ndaccount in "C's Flexible Integer Sizes Were Not a Design Mistake"]]></title><description><![CDATA[
<p>I’m sorry but this is just incorrect. When you take the address of a thread local variable you have to lookup its real address using something like __tls_get_addr or by reading its offset via fs/gs but once it’s in a pointer it’s just a regular absolute address and is fine to dereference on any thread. There is no separate type for a pointer to a thread local variable.</p>
]]></description><pubDate>Sun, 27 Sep 2026 22:15:08 +0000</pubDate><link>https://news.ycombinator.com/item?id=49871381</link><dc:creator>david2ndaccount</dc:creator><comments>https://news.ycombinator.com/item?id=49871381</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49871381</guid></item><item><title><![CDATA[New comment by david2ndaccount in "C's Flexible Integer Sizes Were Not a Design Mistake"]]></title><description><![CDATA[
<p>I don’t know what you mean, if you take the address of a thread local variable you get a regular pointer which is just as safe to dereference as any other pointer, cast through intprt_t or not?</p>
]]></description><pubDate>Sun, 27 Sep 2026 21:23:33 +0000</pubDate><link>https://news.ycombinator.com/item?id=49871000</link><dc:creator>david2ndaccount</dc:creator><comments>https://news.ycombinator.com/item?id=49871000</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49871000</guid></item><item><title><![CDATA[New comment by david2ndaccount in "C's Flexible Integer Sizes Were Not a Design Mistake"]]></title><description><![CDATA[
<p>`thread_local` is a storage class, there is no `thread_local T*` in the same way there is no `static T*`</p>
]]></description><pubDate>Sun, 27 Sep 2026 19:25:43 +0000</pubDate><link>https://news.ycombinator.com/item?id=49869968</link><dc:creator>david2ndaccount</dc:creator><comments>https://news.ycombinator.com/item?id=49869968</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49869968</guid></item></channel></rss>