<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: simonask</title><link>https://news.ycombinator.com/user?id=simonask</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Wed, 10 Jun 2026 08:34:47 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=simonask" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by simonask in "Use your Nvidia GPU's VRAM as swap space on Linux"]]></title><description><![CDATA[
<p>I mean, cool, but I’d rather not?</p>
]]></description><pubDate>Tue, 02 Jun 2026 23:36:24 +0000</pubDate><link>https://news.ycombinator.com/item?id=48377698</link><dc:creator>simonask</dc:creator><comments>https://news.ycombinator.com/item?id=48377698</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48377698</guid></item><item><title><![CDATA[New comment by simonask in "Should you normalize RGB values by 255 or 256?"]]></title><description><![CDATA[
<p>For the record, the mathematically correct answer to this question is that the year 2000 was the last year of the 19th century.<p>The reason is that year 0 never existed. The year 1 BCE was followed by the year 1 CE.<p>Culturally, anthropologically, and psychologically it might be a different matter. But 2000 years had not passed before the end of that year.</p>
]]></description><pubDate>Mon, 01 Jun 2026 23:01:41 +0000</pubDate><link>https://news.ycombinator.com/item?id=48363731</link><dc:creator>simonask</dc:creator><comments>https://news.ycombinator.com/item?id=48363731</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48363731</guid></item><item><title><![CDATA[New comment by simonask in "Migrating from Go to Rust"]]></title><description><![CDATA[
<p>Rust errors are not exceptions. Catching exceptions is unbelievably expensive in all languages that support them, compared to handling a Rust error value.<p>Some languages have exceptions as the only error handling mechanism (C#, Java, scripting languages), and it sounds like that's what you're used to. But this is also broadly agreed to be a severely limiting factor of those languages, resulting from being designed at a time when we didn't know better.<p>If you want to go fast (and Rust does), you cannot be catching exceptions in the hot path, and you certainly can't be throwing exceptions that carry stack traces, because walking the stack to build up the stack trace is many orders of magnitude slower than returning an error value.<p>Rust's error handling modes are designed with the benefit of hindsight from all those other languages from the last few decades, and reflects the fact that errors broadly fall in two categories: validation failures and programmer errors. The former should be a cheap error code that can be handled, the latter should terminate the program/thread/task and give you enough information to diagnose the problem.</p>
]]></description><pubDate>Fri, 29 May 2026 08:26:01 +0000</pubDate><link>https://news.ycombinator.com/item?id=48320552</link><dc:creator>simonask</dc:creator><comments>https://news.ycombinator.com/item?id=48320552</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48320552</guid></item><item><title><![CDATA[New comment by simonask in "The worst job interview I ever had"]]></title><description><![CDATA[
<p>Is it Iceland? Ivory Coast? Ireland? Indonesia?</p>
]]></description><pubDate>Wed, 27 May 2026 10:45:51 +0000</pubDate><link>https://news.ycombinator.com/item?id=48292233</link><dc:creator>simonask</dc:creator><comments>https://news.ycombinator.com/item?id=48292233</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48292233</guid></item><item><title><![CDATA[New comment by simonask in "Performance of Rust Language [pdf]"]]></title><description><![CDATA[
<p>I mean, sure, dead code elimination applies to all optimized code. The important thing to understand is that panicking in Rust does not get magic treatment by the Rust compiler. It’s just a function that is declared in the type system to never return.</p>
]]></description><pubDate>Tue, 26 May 2026 23:39:32 +0000</pubDate><link>https://news.ycombinator.com/item?id=48287494</link><dc:creator>simonask</dc:creator><comments>https://news.ycombinator.com/item?id=48287494</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48287494</guid></item><item><title><![CDATA[New comment by simonask in "What color is your function? (2015)"]]></title><description><![CDATA[
<p>I don’t really see how declaring an unsafe block is materially different for the purposes of this discussion than, e.g., entering an async runtime.<p>It is code you need to write, tradeoffs you need to weigh, invariants you need to keep.</p>
]]></description><pubDate>Tue, 26 May 2026 23:25:44 +0000</pubDate><link>https://news.ycombinator.com/item?id=48287400</link><dc:creator>simonask</dc:creator><comments>https://news.ycombinator.com/item?id=48287400</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48287400</guid></item><item><title><![CDATA[New comment by simonask in "Performance of Rust Language [pdf]"]]></title><description><![CDATA[
<p>Sure, but now you're actually moving the goal posts. We're talking about the practicalities - you can always achieve the same by doing more work, but it makes a difference that Rust gives you `HashMap` in the standard library that you can just use and get best-in-class performance, every time, with zero work, zero maintenance. The only choice you have to make is which hash function you want to plug into it, and since it is generic, that gets optimized and inlined as well (even with LTO disabled).</p>
]]></description><pubDate>Tue, 26 May 2026 17:58:36 +0000</pubDate><link>https://news.ycombinator.com/item?id=48283302</link><dc:creator>simonask</dc:creator><comments>https://news.ycombinator.com/item?id=48283302</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48283302</guid></item><item><title><![CDATA[New comment by simonask in "Performance of Rust Language [pdf]"]]></title><description><![CDATA[
<p>Panics in Rust do not currently time-travel like that (including panics from failed bounds checks), and that's a good thing. The reason is that panicking does not imply terminating the process - they can be caught and handled, just like exceptions in C++. In fact, they use the same stack unwinding mechanism by default.<p>What the compiler <i>is</i> allowed to do is to shorten the loop by one and unconditionally panic after the loop, but this falls under the purview of the LLVM optimizer.</p>
]]></description><pubDate>Tue, 26 May 2026 08:02:24 +0000</pubDate><link>https://news.ycombinator.com/item?id=48276591</link><dc:creator>simonask</dc:creator><comments>https://news.ycombinator.com/item?id=48276591</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48276591</guid></item><item><title><![CDATA[New comment by simonask in "Performance of Rust Language [pdf]"]]></title><description><![CDATA[
<p>LTO cannot change the layout of structs. For something like a hash map implementation, it matters whether inner nodes store a pointer to the key and value, or whether it stores a pointer to each. To achieve this in C, you have no other options than emulating templates using macros.</p>
]]></description><pubDate>Tue, 26 May 2026 07:51:43 +0000</pubDate><link>https://news.ycombinator.com/item?id=48276507</link><dc:creator>simonask</dc:creator><comments>https://news.ycombinator.com/item?id=48276507</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48276507</guid></item><item><title><![CDATA[New comment by simonask in "Migrating from Go to Rust"]]></title><description><![CDATA[
<p>That's because the types of errors where you want a stack trace are a relatively small subset of all possible errors.<p>Stack traces are only useful for errors that indicate a bug in the program, i.e. something a programmers has to respond to. It's not useful for the vast class of bugs that are a result of wrong input, wrong external state, or infrastructure issues.<p>Rust projects tend to favor panicking over error handling for programmer bugs (which does indeed give you a stack trace depending on environment variables), or even better encoding the invariants in the type system, but there are cases where an error coming from a library are truly, actually unexpected, so both `anyhow` and `thiserror` do provide support for attaching a stack trace in those situations.</p>
]]></description><pubDate>Mon, 25 May 2026 11:06:43 +0000</pubDate><link>https://news.ycombinator.com/item?id=48265516</link><dc:creator>simonask</dc:creator><comments>https://news.ycombinator.com/item?id=48265516</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48265516</guid></item><item><title><![CDATA[New comment by simonask in "Converting an Integer to a Decimal String in Under Two Nanoseconds"]]></title><description><![CDATA[
<p>It will be literal decades before RISC-V becomes mainstream. Not because it’s not a perfectly fine ISA, but because business incentive structures aren’t nowhere near supporting it.<p>Literal man-millennia have been poured into writing software for both x86 and ARM, and nobody seems close to designing a competitive RISC-V chip.</p>
]]></description><pubDate>Sun, 24 May 2026 11:16:35 +0000</pubDate><link>https://news.ycombinator.com/item?id=48256348</link><dc:creator>simonask</dc:creator><comments>https://news.ycombinator.com/item?id=48256348</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48256348</guid></item><item><title><![CDATA[New comment by simonask in "Everything in C is undefined behavior"]]></title><description><![CDATA[
<p>Every vectorized string search algorithm (including those treating an unsigned long as a "vector" of 8 bytes) currently needs a prelude that performs the search up to the first alignment boundary, and then performs the bulk of the search on well-aligned blocks, and then finally a postlude search in the tail of the string, where the tail is shorter than the block size/alignment.<p>Using unaligned loads, you can get rid of the prelude, including the associated branches and intptr arithmetic, and just have to deal with the tail.<p>If you're comparing short-ish strings, almost all of the time is spent in the prelude and postlude, even if the entire substring fits in a register. This is a silly language limitation when the hardware can actually easily just support the unaligned load.<p>In particular, it doesn't seem justified that what at most amounts to a tiny inefficiency in hardware turns into a very expensive class of bugs (UB).</p>
]]></description><pubDate>Sat, 23 May 2026 09:20:18 +0000</pubDate><link>https://news.ycombinator.com/item?id=48246138</link><dc:creator>simonask</dc:creator><comments>https://news.ycombinator.com/item?id=48246138</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48246138</guid></item><item><title><![CDATA[New comment by simonask in "Everything in C is undefined behavior"]]></title><description><![CDATA[
<p>You didn’t really say that, but feel free to share any reasons you might have to think so.<p>I don’t see any reason why it wouldn’t be perfectly fine on recent hardware, where unaligned loads are just as fast, and the cache pressure is identical for a linear search algorithm.</p>
]]></description><pubDate>Thu, 21 May 2026 16:44:03 +0000</pubDate><link>https://news.ycombinator.com/item?id=48225619</link><dc:creator>simonask</dc:creator><comments>https://news.ycombinator.com/item?id=48225619</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48225619</guid></item><item><title><![CDATA[New comment by simonask in "Everything in C is undefined behavior"]]></title><description><![CDATA[
<p>> In the C ecosystem, the compiler gets to define what UB means.<p>It really doesn't though. The current revision of the  ISO/IEC 9899 standards document gets to define it, nobody else.</p>
]]></description><pubDate>Thu, 21 May 2026 08:28:59 +0000</pubDate><link>https://news.ycombinator.com/item?id=48219517</link><dc:creator>simonask</dc:creator><comments>https://news.ycombinator.com/item?id=48219517</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48219517</guid></item><item><title><![CDATA[New comment by simonask in "Everything in C is undefined behavior"]]></title><description><![CDATA[
<p>If you're aware of that technique, why were you asking about use cases for unaligned loads?</p>
]]></description><pubDate>Thu, 21 May 2026 08:26:51 +0000</pubDate><link>https://news.ycombinator.com/item?id=48219502</link><dc:creator>simonask</dc:creator><comments>https://news.ycombinator.com/item?id=48219502</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48219502</guid></item><item><title><![CDATA[New comment by simonask in "Goodbye Visa and Mastercard: 130M Europeans switching to sovereign payment"]]></title><description><![CDATA[
<p>> Assuming by "grown-ups" you mean Team Blue<p>I am deeply, profoundly, emphatically uninterested in your "teams". Your local news are not relevant to us. What the rest of the world sees is US foreign policy, and the <i>mainstream</i> sentiment in every other Western nation right now is one of second-hand embarrassment.<p>Also the ethnic cleansing does not look great.</p>
]]></description><pubDate>Wed, 20 May 2026 18:44:06 +0000</pubDate><link>https://news.ycombinator.com/item?id=48212178</link><dc:creator>simonask</dc:creator><comments>https://news.ycombinator.com/item?id=48212178</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48212178</guid></item><item><title><![CDATA[New comment by simonask in "Everything in C is undefined behavior"]]></title><description><![CDATA[
<p>Strings typically consist of UTF-8 bytes, and any old `char*` pair has no alignment guarantees.</p>
]]></description><pubDate>Wed, 20 May 2026 18:37:20 +0000</pubDate><link>https://news.ycombinator.com/item?id=48212097</link><dc:creator>simonask</dc:creator><comments>https://news.ycombinator.com/item?id=48212097</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48212097</guid></item><item><title><![CDATA[New comment by simonask in "Everything in C is undefined behavior"]]></title><description><![CDATA[
<p>String search algorithms would be one example, where a 64-bit register can be used as a “vector” containing 8x1 bytes.</p>
]]></description><pubDate>Wed, 20 May 2026 13:58:21 +0000</pubDate><link>https://news.ycombinator.com/item?id=48207904</link><dc:creator>simonask</dc:creator><comments>https://news.ycombinator.com/item?id=48207904</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48207904</guid></item><item><title><![CDATA[New comment by simonask in "Goodbye Visa and Mastercard: 130M Europeans switching to sovereign payment"]]></title><description><![CDATA[
<p>Who cares at this point. Nothing has ever managed to unite Europeans as effectively as the orange man’s unrelenting torrent of temper tantrums over the past year and a half.<p>Americans, we know some of you aren’t crazy. Can’t wait for the grown-ups to be in charge again, but in the mean time we’ll be moving on.</p>
]]></description><pubDate>Wed, 20 May 2026 13:36:00 +0000</pubDate><link>https://news.ycombinator.com/item?id=48207518</link><dc:creator>simonask</dc:creator><comments>https://news.ycombinator.com/item?id=48207518</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48207518</guid></item><item><title><![CDATA[New comment by simonask in "Everything in C is undefined behavior"]]></title><description><![CDATA[
<p>I don’t think any of that is justification for making unaligned access UB. It’s reason to avoid it or discourage it in certain scenarios, but it’s infinitesimally rare that loading 8 bytes instead of 4 is even measurable, and that includes embedded.</p>
]]></description><pubDate>Wed, 20 May 2026 13:16:51 +0000</pubDate><link>https://news.ycombinator.com/item?id=48207208</link><dc:creator>simonask</dc:creator><comments>https://news.ycombinator.com/item?id=48207208</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48207208</guid></item></channel></rss>