<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: ridiculous_fish</title><link>https://news.ycombinator.com/user?id=ridiculous_fish</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Sun, 07 Jun 2026 22:24:35 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=ridiculous_fish" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by ridiculous_fish in "New 10 GbE USB adapters are cooler, smaller, cheaper"]]></title><description><![CDATA[
<p>I bought one of these as soon as I heard about it ($74 from eBay) and tested it against my USB-4 AQC113 mainstays ($87, IO CREST brand on Amazon), from my MBP.<p>The new RTL-based adapter is physically smaller, runs way cooler, but only gets ~6 Gbps from my Mac to my Linux box, with a lot of jitter (iperf3).<p>The AQC adapter is all metal, gets uncomfortably hot, and sustains 9.3 Gbps, no problem. It's about the same size as the middle adapter in the photo.<p>The USB-4 AQC adapters are only ~$13 more, and yet are significantly faster with lower jitter.  I'm staying with those.<p>Hope that helps someone!</p>
]]></description><pubDate>Sun, 26 Apr 2026 00:24:55 +0000</pubDate><link>https://news.ycombinator.com/item?id=47906063</link><dc:creator>ridiculous_fish</dc:creator><comments>https://news.ycombinator.com/item?id=47906063</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47906063</guid></item><item><title><![CDATA[New comment by ridiculous_fish in "Optimization of 32-bit Unsigned Division by Constants on 64-bit Targets"]]></title><description><![CDATA[
<p>This paper missed the state of the art!!!<p>This concerns unsigned division by a 32 bit constant divisor. Compilers routinely optimize this to a high-multiply by a "magic number" but this number may be up to 33 bits (worst-case, divisor dependent, 7 is a problem child). So you may need a 32x33-bit high multiply.<p>What compilers do today is some bit tricks to perform a 32x33 bit high multiply through a 32x32 multiply and then handling the last bit specially, through additions and bitshifts. That's the "GM Method" in the paper; the juice to be squeezed out is the extra stuff to handle the 33rd bit.<p>What the paper observes is that 32x33 high multiply can be performed via a 64x64 high multiply and then the extra stuff goes away. Well yes, of course.<p>But amazingly in ALL of these worst case situations you can compute a different magic number, and perform a (saturating) increment of the dividend at runtime, and ONLY need a 32 bit high multiply.<p>That is, these are the two algorithms for unsigned division by constants where the magic number overflows:<p>- This paper: Promote to twice the bit width, followed by high multiply (32x64 => 64) and then bitshift<p>- SOTA: Saturating increment of the dividend, then high multiply (32x32 => 32) and then bitshift<p>Probably the paper's approach is a little better on wide multipliers, but they missed this well-known technique published 15 years ago (and before that, I merely rediscovered it):<p><a href="https://ridiculousfish.com/blog/posts/labor-of-division-episode-iii.html" rel="nofollow">https://ridiculousfish.com/blog/posts/labor-of-division-epis...</a></p>
]]></description><pubDate>Mon, 13 Apr 2026 05:52:10 +0000</pubDate><link>https://news.ycombinator.com/item?id=47748097</link><dc:creator>ridiculous_fish</dc:creator><comments>https://news.ycombinator.com/item?id=47748097</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47748097</guid></item><item><title><![CDATA[New comment by ridiculous_fish in "Solod – A subset of Go that translates to C"]]></title><description><![CDATA[
<p>I was curious how defer is implemented. `defer` in Go is famously function-scoped, not lexically-scoped. This means that the number of actively-deferred statements is unbounded, which implies heap allocation.<p>The answer is that Solod breaks with Go semantics here: it just makes defer block-scoped (and unavailable in for/if blocks, which I don't quite get).<p><a href="https://github.com/solod-dev/solod/blob/main/doc/spec.md#defer" rel="nofollow">https://github.com/solod-dev/solod/blob/main/doc/spec.md#def...</a></p>
]]></description><pubDate>Tue, 07 Apr 2026 03:35:44 +0000</pubDate><link>https://news.ycombinator.com/item?id=47670443</link><dc:creator>ridiculous_fish</dc:creator><comments>https://news.ycombinator.com/item?id=47670443</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47670443</guid></item><item><title><![CDATA[New comment by ridiculous_fish in "Ask HN: Who is hiring? (April 2026)"]]></title><description><![CDATA[
<p>Thank you for flagging this, that definitely shouldn't be happening. Possibly we have an over-zealous spam filter. If you and your friend are open to it, please email me at pca@[company].com and I will personally look into it.</p>
]]></description><pubDate>Thu, 02 Apr 2026 18:31:58 +0000</pubDate><link>https://news.ycombinator.com/item?id=47618334</link><dc:creator>ridiculous_fish</dc:creator><comments>https://news.ycombinator.com/item?id=47618334</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47618334</guid></item><item><title><![CDATA[New comment by ridiculous_fish in "Ask HN: Who is hiring? (April 2026)"]]></title><description><![CDATA[
<p>Oklo | Remote (US) or Santa Clara or Brooklyn | Full time | <a href="https://oklo.com" rel="nofollow">https://oklo.com</a><p>Join us in pioneering the next generation of nuclear reactors! You'll leverage your software skills alongside nuclear engineers to model, simulate, design, and deploy advanced fission power technology. You will work at the forefront of the nuclear industry, developing novel techniques to reach new levels of safety, efficiency, and resiliency. Come be a part of powering the future with advanced fission power plants to provide clean, reliable, affordable energy.<p>We are hiring for:<p>- Software Engineer: <a href="https://job-boards.greenhouse.io/oklo/jobs/4018702004" rel="nofollow">https://job-boards.greenhouse.io/oklo/jobs/4018702004</a><p>- Senior Software Engineer: <a href="https://job-boards.greenhouse.io/oklo/jobs/5739483004" rel="nofollow">https://job-boards.greenhouse.io/oklo/jobs/5739483004</a><p>- Software Engineer (Infrastructure): <a href="https://job-boards.greenhouse.io/oklo/jobs/5784826004" rel="nofollow">https://job-boards.greenhouse.io/oklo/jobs/5784826004</a><p>- Software Quality Assurance Lead: <a href="https://job-boards.greenhouse.io/oklo/jobs/5480416004" rel="nofollow">https://job-boards.greenhouse.io/oklo/jobs/5480416004</a><p>See more opportunities here: <a href="https://job-boards.greenhouse.io/oklo" rel="nofollow">https://job-boards.greenhouse.io/oklo</a><p>Please mention Hacker News in your cover letter!</p>
]]></description><pubDate>Wed, 01 Apr 2026 16:27:17 +0000</pubDate><link>https://news.ycombinator.com/item?id=47603039</link><dc:creator>ridiculous_fish</dc:creator><comments>https://news.ycombinator.com/item?id=47603039</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47603039</guid></item><item><title><![CDATA[New comment by ridiculous_fish in "Everything old is new again: memory optimization"]]></title><description><![CDATA[
<p>Why would an allocation require an atomic write for a reference count?<p>Swift routinely optimizes out reference count traffic.</p>
]]></description><pubDate>Fri, 27 Mar 2026 20:27:00 +0000</pubDate><link>https://news.ycombinator.com/item?id=47547798</link><dc:creator>ridiculous_fish</dc:creator><comments>https://news.ycombinator.com/item?id=47547798</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47547798</guid></item><item><title><![CDATA[New comment by ridiculous_fish in "Zero-Cost POSIX Compliance: Encoding the Socket State Machine in Lean's Types"]]></title><description><![CDATA[
<p>That's exactly what affine / linear types do.</p>
]]></description><pubDate>Wed, 25 Mar 2026 04:31:20 +0000</pubDate><link>https://news.ycombinator.com/item?id=47513262</link><dc:creator>ridiculous_fish</dc:creator><comments>https://news.ycombinator.com/item?id=47513262</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47513262</guid></item><item><title><![CDATA[New comment by ridiculous_fish in "Python 3.15's JIT is now back on track"]]></title><description><![CDATA[
<p>JS (when using ints, which v8 does) is the same in this respect.</p>
]]></description><pubDate>Wed, 18 Mar 2026 01:37:26 +0000</pubDate><link>https://news.ycombinator.com/item?id=47420666</link><dc:creator>ridiculous_fish</dc:creator><comments>https://news.ycombinator.com/item?id=47420666</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47420666</guid></item><item><title><![CDATA[New comment by ridiculous_fish in "Windows: Microsoft broke the only thing that mattered"]]></title><description><![CDATA[
<p>"and a MacBook Air M4 starts at $1,099 against a capable Windows laptop at around $400"<p>Pardon?</p>
]]></description><pubDate>Tue, 10 Mar 2026 05:33:52 +0000</pubDate><link>https://news.ycombinator.com/item?id=47319404</link><dc:creator>ridiculous_fish</dc:creator><comments>https://news.ycombinator.com/item?id=47319404</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47319404</guid></item><item><title><![CDATA[New comment by ridiculous_fish in "Lie groups are crucial to some of the most fundamental theories in physics"]]></title><description><![CDATA[
<p>The “tangle of spheres and circles” is probably a reference to the Hopf fibration.</p>
]]></description><pubDate>Wed, 03 Dec 2025 21:40:40 +0000</pubDate><link>https://news.ycombinator.com/item?id=46140549</link><dc:creator>ridiculous_fish</dc:creator><comments>https://news.ycombinator.com/item?id=46140549</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=46140549</guid></item><item><title><![CDATA[New comment by ridiculous_fish in "The Lucas-Lehmer Prime Number Test"]]></title><description><![CDATA[
<p>Except 91.</p>
]]></description><pubDate>Wed, 19 Nov 2025 23:56:54 +0000</pubDate><link>https://news.ycombinator.com/item?id=45986997</link><dc:creator>ridiculous_fish</dc:creator><comments>https://news.ycombinator.com/item?id=45986997</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=45986997</guid></item><item><title><![CDATA[New comment by ridiculous_fish in "Fil-C: A memory-safe C implementation"]]></title><description><![CDATA[
<p>Extraordinary project. I had several questions which I believe I have answered for myself (pizlonator please correct if wrong):<p>1. How do we prevent loading a bogus lower through misaligned store or load?<p>Answer: Misaligned pointer load/stores are trapped; this is simply not allowed.<p>2. How are pointer stores through a pointer implemented (e.g. `*(char **)p = s`) - does the runtime have to check if *p is "flight" or "heap" to know where to store the lower?<p>Answer: no. Flight (i.e. local) pointers whose address is taken are not literally implemented as two adjacent words; rather the call frame is allocated with the same object layout as a heap object. The flight pointer is its "intval" and its paired "lower" is at the same offset in the "aux" allocation (presumably also allocated as part of the frame?).<p>3. How are use-after-return errors prevented? Say I store a local pointer in a global variable and then return. Later, I call a new function which overwrites the original frame - can't I get a bogus `lower` this way?<p>Answer: no. Call frames are allocated by the GC, not the usual C stack. The global reference will keep the call frame alive.<p>That leads to the following program, which definitely should not work, and yet does. ~Amazing~ Unbelievable:<p><pre><code>    #include <stdio.h>
    
    char *bottles[100];
    
    __attribute__((noinline))
    void beer(int count) {
        char buf[64];
        sprintf(buf, "%d bottles of beer on the wall", count);
        bottles[count] = buf;
    }
    
    int main(void) {
        for (int i=0; i < 100; i++) beer(i);
        for (int i=99; i >= 0; i--) puts(bottles[i]);
    }</code></pre></p>
]]></description><pubDate>Wed, 29 Oct 2025 05:38:15 +0000</pubDate><link>https://news.ycombinator.com/item?id=45743019</link><dc:creator>ridiculous_fish</dc:creator><comments>https://news.ycombinator.com/item?id=45743019</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=45743019</guid></item><item><title><![CDATA[New comment by ridiculous_fish in "Teardown of Apple 40W dynamic power adapter with 60W max"]]></title><description><![CDATA[
<p>What's interesting about it is that it supports SPR AVS, which is a new USB power delivery spec. I'm not aware of any other chargers that support this.<p><a href="https://www.chargerlab.com/complete-pd-3-2-spr-avs-specification-including-full-usb-pd-protocol-download/" rel="nofollow">https://www.chargerlab.com/complete-pd-3-2-spr-avs-specifica...</a></p>
]]></description><pubDate>Sat, 20 Sep 2025 22:22:00 +0000</pubDate><link>https://news.ycombinator.com/item?id=45318139</link><dc:creator>ridiculous_fish</dc:creator><comments>https://news.ycombinator.com/item?id=45318139</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=45318139</guid></item><item><title><![CDATA[New comment by ridiculous_fish in "WASM 3.0 Completed"]]></title><description><![CDATA[
<p>Doesn't every WASM program have to carry its own malloc/free today?</p>
]]></description><pubDate>Wed, 17 Sep 2025 18:42:40 +0000</pubDate><link>https://news.ycombinator.com/item?id=45279749</link><dc:creator>ridiculous_fish</dc:creator><comments>https://news.ycombinator.com/item?id=45279749</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=45279749</guid></item><item><title><![CDATA[New comment by ridiculous_fish in "Float Exposed"]]></title><description><![CDATA[
<p>You're right, thank you for the correction.</p>
]]></description><pubDate>Fri, 12 Sep 2025 04:39:02 +0000</pubDate><link>https://news.ycombinator.com/item?id=45218680</link><dc:creator>ridiculous_fish</dc:creator><comments>https://news.ycombinator.com/item?id=45218680</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=45218680</guid></item><item><title><![CDATA[New comment by ridiculous_fish in "Float Exposed"]]></title><description><![CDATA[
<p>My favorite FP Fun Fact is that float comparisons can (almost) use integer comparisons. To determine if a > b, reinterpret a and b as signed ints and just compare those like any old ints. It (almost) works!<p>The implication is that the next biggest float is (almost) always what you get when you reinterpret its bits as an integer, and add one. For example, start with the zero float: all bits zero. Add one using integer arithmetic. In int-speak it's just one; in float-speak it's a tiny-mantissa denormal. But that's the next float; and `nextafter` is implemented using <i>integer</i> arithmetic.<p>Learning that floats are ordered according to integer comparisons makes it feel way more natural. But of course there's the usual asterisks: this fails with NaNs, infinities, and negative zero. We get a few nice things, but only a few.</p>
]]></description><pubDate>Fri, 12 Sep 2025 03:33:08 +0000</pubDate><link>https://news.ycombinator.com/item?id=45218419</link><dc:creator>ridiculous_fish</dc:creator><comments>https://news.ycombinator.com/item?id=45218419</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=45218419</guid></item><item><title><![CDATA[New comment by ridiculous_fish in "The Core of Rust"]]></title><description><![CDATA[
<p>Affine types, variance, higher-rank trait bounds, phantom data, MaybeUninit, and the whole macro and proc-macro systems are some examples of concepts that I found to be challenging when learning Rust.<p>Dyn-safety is another but I had encountered that previously in Swift.</p>
]]></description><pubDate>Fri, 22 Aug 2025 01:52:55 +0000</pubDate><link>https://news.ycombinator.com/item?id=44980281</link><dc:creator>ridiculous_fish</dc:creator><comments>https://news.ycombinator.com/item?id=44980281</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=44980281</guid></item><item><title><![CDATA[New comment by ridiculous_fish in "Modern CMake"]]></title><description><![CDATA[
<p>LLVM's CMake build has had lots of love poured into it.</p>
]]></description><pubDate>Tue, 15 Apr 2025 21:26:53 +0000</pubDate><link>https://news.ycombinator.com/item?id=43698593</link><dc:creator>ridiculous_fish</dc:creator><comments>https://news.ycombinator.com/item?id=43698593</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=43698593</guid></item><item><title><![CDATA[New comment by ridiculous_fish in "Ask HN: Who is hiring? (April 2025)"]]></title><description><![CDATA[
<p>Oklo | Remote (US) or Santa Clara or Brooklyn | Full time | <a href="https://oklo.com" rel="nofollow">https://oklo.com</a><p>Join us in pioneering the next generation of nuclear reactors! You'll leverage your software skills alongside nuclear engineers to model, simulate, design, and deploy advanced fission power technology. You will work at the forefront of the nuclear industry, developing novel techniques to reach new levels of safety, efficiency, and resiliency. Come be a part of powering the future with advanced fission power plants to provide clean, reliable, affordable energy.<p>We are hiring for:<p>- Software Engineer: <a href="https://job-boards.greenhouse.io/oklo/jobs/4018702004" rel="nofollow">https://job-boards.greenhouse.io/oklo/jobs/4018702004</a><p>- Software Quality Assurance Engineer: <a href="https://job-boards.greenhouse.io/oklo/jobs/5480416004" rel="nofollow">https://job-boards.greenhouse.io/oklo/jobs/5480416004</a><p>See more opportunities here: <a href="https://job-boards.greenhouse.io/oklo" rel="nofollow">https://job-boards.greenhouse.io/oklo</a><p>Please mention Hacker News in your cover letter!</p>
]]></description><pubDate>Thu, 03 Apr 2025 01:02:22 +0000</pubDate><link>https://news.ycombinator.com/item?id=43563583</link><dc:creator>ridiculous_fish</dc:creator><comments>https://news.ycombinator.com/item?id=43563583</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=43563583</guid></item><item><title><![CDATA[New comment by ridiculous_fish in "Ask HN: Do you still self-host a blog? What's your publishing stack?"]]></title><description><![CDATA[
<p>Jekyll and nginx in Docker on Hetzner for €4.49/mo</p>
]]></description><pubDate>Tue, 01 Apr 2025 03:41:10 +0000</pubDate><link>https://news.ycombinator.com/item?id=43542611</link><dc:creator>ridiculous_fish</dc:creator><comments>https://news.ycombinator.com/item?id=43542611</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=43542611</guid></item></channel></rss>