<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: moefh</title><link>https://news.ycombinator.com/user?id=moefh</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Mon, 19 Oct 2026 20:04:58 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=moefh" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by moefh in "BIPM decides to stop adding leap seconds to UTC"]]></title><description><![CDATA[
<p>Even in reasonable time zones, significant distance between noon and 12:00 is inevitable. For example, Las Vegas and San Francisco are in the same time zone but one sees the Sun rise about half an hour earlier than the other.<p>Worrying about a couple of seconds or even minutes is completely insane for almost everyone.</p>
]]></description><pubDate>Fri, 16 Oct 2026 00:34:33 +0000</pubDate><link>https://news.ycombinator.com/item?id=50112211</link><dc:creator>moefh</dc:creator><comments>https://news.ycombinator.com/item?id=50112211</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50112211</guid></item><item><title><![CDATA[New comment by moefh in "BIPM decides to stop adding leap seconds to UTC"]]></title><description><![CDATA[
<p>> our only option is to not care about aligning clock time to the sun<p>No, an easy option is to simply shift every timezone by an hour and keep UTC intact. A ton of places already do that twice a year for daylight savings.<p>I never understood why we mess with UTC so much when we already have another widely used mechanism to keep the sun and clocks aligned.</p>
]]></description><pubDate>Thu, 15 Oct 2026 22:01:57 +0000</pubDate><link>https://news.ycombinator.com/item?id=50111004</link><dc:creator>moefh</dc:creator><comments>https://news.ycombinator.com/item?id=50111004</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50111004</guid></item><item><title><![CDATA[New comment by moefh in "Casey Muratori – The Root of the Root of All Evil – BSC 2026 [video]"]]></title><description><![CDATA[
<p>He works in the engine/tool side of things. He worked on some widely used libraries, mainly Bink 2 (video codec) and Granny 3D (3D animation) used in a ton of shipped games.</p>
]]></description><pubDate>Sun, 30 Aug 2026 14:44:08 +0000</pubDate><link>https://news.ycombinator.com/item?id=49499108</link><dc:creator>moefh</dc:creator><comments>https://news.ycombinator.com/item?id=49499108</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49499108</guid></item><item><title><![CDATA[New comment by moefh in "200 Milliseconds"]]></title><description><![CDATA[
<p>Lisa's dictionary is different from widely-used real dictionaries. Here's what Merriam-Webster says[1]:<p><pre><code>    Some assert that only envious is correctly used to describe someone who feels or shows a very strong desire for something that belongs to someone else, but in truth both envious and jealous commonly carry this meaning. Jealous alone is used to describe someone who tends to suspect unfaithfulness.
</code></pre>
[1] <a href="https://www.merriam-webster.com/dictionary/envious" rel="nofollow">https://www.merriam-webster.com/dictionary/envious</a></p>
]]></description><pubDate>Tue, 04 Aug 2026 04:26:14 +0000</pubDate><link>https://news.ycombinator.com/item?id=49164355</link><dc:creator>moefh</dc:creator><comments>https://news.ycombinator.com/item?id=49164355</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49164355</guid></item><item><title><![CDATA[New comment by moefh in "Should you normalize RGB values by 255 or 256?"]]></title><description><![CDATA[
<p>This problem of what <i>exactly</i> a color value means is mostly inconsequential when you have 8 bits per component, the difference in the <i>denominator</i> being either 255 or 256 makes the errors tiny, you must have really good color perception and get really close to the screen to see any difference at all, and your monitor/phone screen is probably not calibrated  anyway, so who cares.<p>It becomes a pain in the ass when you're generating a VGA signal with a microcontroller with 8 color output pins (3 red, 3 green, 2 blue). The meaning of a color value is <i>very</i> real in this setup: it corresponds to a voltage level you must send to the VGA monitor, 0V-0.7V.<p>So the blue channel will map (0->0V, 1->0.23V, 2->0.47V, 3->0.7V), and the red/green will map (0->0V, 1->0.1V, ..., 7->0.7V). Notice how none of the blue voltages match any of the red/green ones (other than the extremes)? That means you don't get to see any pure grays -- the closest ones will have bit of blue or yellow tint, depending on the direction of the difference.<p>Not only that, any gradients at all (other than the ones not mixing blue with the other channels) will be noticeable off: for example, the closest colors in the line between pure red to pure white will all be slightly orange or purple.<p>Code for VGA output in 8-bit color with double-buffered 320x240 framebuffer for the Raspberry Pi Pico 2 here, if anyone cares: <a href="https://github.com/moefh/pico-vga-8bit-demo" rel="nofollow">https://github.com/moefh/pico-vga-8bit-demo</a></p>
]]></description><pubDate>Mon, 01 Jun 2026 23:01:31 +0000</pubDate><link>https://news.ycombinator.com/item?id=48363726</link><dc:creator>moefh</dc:creator><comments>https://news.ycombinator.com/item?id=48363726</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48363726</guid></item><item><title><![CDATA[New comment by moefh in "Only 17% of all 64-bit Integers are products of two 32-bit integers"]]></title><description><![CDATA[
<p>I think they meant to write "There are about 4 billion <i>TIMES</i> more 64 bit integers than 32 bit integers".</p>
]]></description><pubDate>Mon, 01 Jun 2026 14:40:32 +0000</pubDate><link>https://news.ycombinator.com/item?id=48357459</link><dc:creator>moefh</dc:creator><comments>https://news.ycombinator.com/item?id=48357459</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48357459</guid></item><item><title><![CDATA[New comment by moefh in "Show HN: Rust but Lisp"]]></title><description><![CDATA[
<p>Pretty nifty. As of now, the code doesn't compile: there's some stray "span" stuff in codegen.rs[1], and it's trying to format `Warning` which doesn't implement `Display` in main.rs[2].<p>Fixing these, it runs mostly as advertised, but it seems to assume that one-letter types are always generic parameters, so it's impossible to (for example) generate this:<p><pre><code>    struct X;
    enum A {
        P(X),
        Q
    }
</code></pre>
Trying this:<p><pre><code>    (struct X)
    (enum A (P X) Q)
</code></pre>
produces this:<p><pre><code>    struct X;
    enum A<P, X> { Q }
</code></pre>
while using a multi-letter type like `String`:<p><pre><code>    (enum A (P String) Q)
</code></pre>
produces the expected:<p><pre><code>    enum A { P(String), Q }
</code></pre>
One way to solve this would be to always require the generic annotation, and let it be empty when there are no generics, but when I tried that it did something weird:<p><pre><code>    (struct X)
    (enum A () (P X) Q)
</code></pre>
produces:<p><pre><code>    struct X;
    enum A {
        _ /* List([], Some(Span { start: 54, end: 56 })) */,
        P(X),
        Q
    }
</code></pre>
I have no idea where the `_` and the comment came from.<p>[1] <a href="https://github.com/ThatXliner/rust-but-lisp/blob/70c51a107b2ca898b71a0b55e070c466c3bb1704/src/codegen.rs#L61" rel="nofollow">https://github.com/ThatXliner/rust-but-lisp/blob/70c51a107b2...</a><p>[2] <a href="https://github.com/ThatXliner/rust-but-lisp/blob/70c51a107b2ca898b71a0b55e070c466c3bb1704/src/main.rs#L59" rel="nofollow">https://github.com/ThatXliner/rust-but-lisp/blob/70c51a107b2...</a></p>
]]></description><pubDate>Sun, 10 May 2026 06:17:30 +0000</pubDate><link>https://news.ycombinator.com/item?id=48081455</link><dc:creator>moefh</dc:creator><comments>https://news.ycombinator.com/item?id=48081455</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48081455</guid></item><item><title><![CDATA[New comment by moefh in "Floating point from scratch: Hard Mode"]]></title><description><![CDATA[
<p>Nice write-up.<p>Let me offer a nitpck: in the "Gradual underflow" section it says this about subnormal numbers:<p><pre><code>    Bonus: we have now acquired extra armour against a division by zero:

    if ( x != y ) z = 1.0 / ( x - y );
</code></pre>
But that's not that useful: just because you're not dividing by zero doesn't mean the result won't overflow to infinity, which is what you get when you <i>do</i> divide by zero.<p>Think about it this way: the smallest subnormal double is on the order of 10^-324, but the largest double is on the order of 10^308. If `x - y` is smaller than 10^-308, `1.0 / (x - y)` will be larger than 10^308, which can't be represented and must overflow to infinity.<p>This C program demonstrates this:<p><pre><code>    #include <stdio.h>
    #include <float.h>
    #include <math.h>

    // return a (subnormal) number that results in zero when divided by 2:
    double calc_tiny(void)
    {
        double x = DBL_MIN; // the normal number closest to 0.0
        while (1) {
            double next = x / 2.0;
            if (next == 0.0) {
                return x;
            }
            x = next;
        }
    }

    int main(void)
    {
        double y = calc_tiny();
        double x = 2.0 * y;
        if (x != y) {
            double z = 1.0 / (x - y);
            printf("division is safe: %g\n", z);
        } else {
            printf("refusing to divide by zero\n");
        }
    }
</code></pre>
(It will print something like "division is safe: inf", or however else your libc prints infinity)</p>
]]></description><pubDate>Tue, 07 Apr 2026 15:37:27 +0000</pubDate><link>https://news.ycombinator.com/item?id=47677005</link><dc:creator>moefh</dc:creator><comments>https://news.ycombinator.com/item?id=47677005</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47677005</guid></item><item><title><![CDATA[New comment by moefh in "A tail-call interpreter in (nightly) Rust"]]></title><description><![CDATA[
<p>Yes, I agree. Like I said, it <i>might</i> be useful when dealing with something that is easier to express in (tail) recursion form instead of an iteration.<p>Anyway, here's something more-or-less equivalent in Rust, which will blow the stack if made to loop too many times: <a href="https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=42d597503ef128d8e79cfbb1a466b129" rel="nofollow">https://play.rust-lang.org/?version=stable&mode=debug&editio...</a><p>(There may be a way to use a closure instead of a function to avoid hard-coding the type of `$i` in the macro, but I can't find an easy way to write a recursive closure call in Rust).</p>
]]></description><pubDate>Mon, 06 Apr 2026 17:51:49 +0000</pubDate><link>https://news.ycombinator.com/item?id=47664379</link><dc:creator>moefh</dc:creator><comments>https://news.ycombinator.com/item?id=47664379</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47664379</guid></item><item><title><![CDATA[New comment by moefh in "A tail-call interpreter in (nightly) Rust"]]></title><description><![CDATA[
<p>I'm not sure how this would be useful in Rust, but macros and tail calls are what allows one to (for example) write iterative loops in Scheme, which doesn't have a native loop syntax.<p>Maybe the same idea can be used in Rust where some constructs are easier to write in recursive form instead of a loop?<p>In any case, here's a silly example of a `for-loop` macro in Scheme using a tail call:<p><pre><code>    (define-syntax for-loop
      (syntax-rules ()
        ((for-loop var start end body ...)
         (letrec ((loop (lambda (var)
                          (unless (>= var end)
                            body ...
                            (loop (+ var 1))))))  ; <-- tail call
           (loop start)))))
</code></pre>
And here's how you'd use it to print the numbers 0 to 9:<p><pre><code>    (for-loop i 0 10
              (display i)
              (newline))
</code></pre>
This macro expands to a function that calls itself to loop. Since Scheme is guaranteed to have proper tail calls, the calls are guaranteed to not blow the stack.<p>(Note that you'll probably never see a `letrec` used like this: people would use a named `let`, which is syntax sugar for that exact usage of `letrec`. I wrote it the `letrec` way to make the function explicit).</p>
]]></description><pubDate>Mon, 06 Apr 2026 03:00:09 +0000</pubDate><link>https://news.ycombinator.com/item?id=47656484</link><dc:creator>moefh</dc:creator><comments>https://news.ycombinator.com/item?id=47656484</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47656484</guid></item><item><title><![CDATA[New comment by moefh in "What came after the 486?"]]></title><description><![CDATA[
<p>Shouldn't that be 0xc8c70ff0, since we're talking about a little-endian CPU? (according to this[1] the bytes in memory are F0 0F C7 C8).<p>On the other hand, I probably wouldn't have recognized the F00F bug mention if you had actually written 0xc8c70ff0.<p>[1] <a href="https://en.wikipedia.org/wiki/Pentium_F00F_bug" rel="nofollow">https://en.wikipedia.org/wiki/Pentium_F00F_bug</a></p>
]]></description><pubDate>Thu, 26 Mar 2026 18:15:24 +0000</pubDate><link>https://news.ycombinator.com/item?id=47533865</link><dc:creator>moefh</dc:creator><comments>https://news.ycombinator.com/item?id=47533865</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47533865</guid></item><item><title><![CDATA[New comment by moefh in "New evidence that Cantor plagiarized Dedekind?"]]></title><description><![CDATA[
<p>Being "not very inaccurate" is very different from publishing outright fabricated quotes, which is what Ars Technica did and later admitted to: <a href="https://arstechnica.com/staff/2026/02/editors-note-retraction-of-article-containing-fabricated-quotations/" rel="nofollow">https://arstechnica.com/staff/2026/02/editors-note-retractio...</a></p>
]]></description><pubDate>Sat, 28 Feb 2026 22:40:22 +0000</pubDate><link>https://news.ycombinator.com/item?id=47201118</link><dc:creator>moefh</dc:creator><comments>https://news.ycombinator.com/item?id=47201118</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47201118</guid></item><item><title><![CDATA[New comment by moefh in "Raspberry Pi Pico 2 at 873.5MHz with 3.05V Core Abuse"]]></title><description><![CDATA[
<p>Great stuff.<p>It wouldn't be surprising if the RP2350 gets officially certified to run at something above the max supported clock at launch (150MHz), though obviously nothing close to 800MHz. That happened to the RP2040[1], which at launch nominally supported 133MHz but now it's up to 200MHz (the SDK still defaults to 125MHz for compatibility, but getting 200MHz is as simple as toggling a config flag[2]).<p>[1] <a href="https://www.tomshardware.com/raspberry-pi/the-raspberry-pi-picos-rp2040-has-been-certified-for-200-mhz-clock-speeds-up-from-133-mhz" rel="nofollow">https://www.tomshardware.com/raspberry-pi/the-raspberry-pi-p...</a><p>[2] <a href="https://github.com/raspberrypi/pico-sdk/releases/tag/2.1.1" rel="nofollow">https://github.com/raspberrypi/pico-sdk/releases/tag/2.1.1</a></p>
]]></description><pubDate>Fri, 20 Feb 2026 13:16:18 +0000</pubDate><link>https://news.ycombinator.com/item?id=47087638</link><dc:creator>moefh</dc:creator><comments>https://news.ycombinator.com/item?id=47087638</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47087638</guid></item><item><title><![CDATA[New comment by moefh in "The most famous transcendental numbers"]]></title><description><![CDATA[
<p>Yes. A number is transcendental if it's not the root of a polynomial with integer coefficients; that's completely independent of how you represent it.</p>
]]></description><pubDate>Wed, 31 Dec 2025 13:37:41 +0000</pubDate><link>https://news.ycombinator.com/item?id=46443949</link><dc:creator>moefh</dc:creator><comments>https://news.ycombinator.com/item?id=46443949</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=46443949</guid></item><item><title><![CDATA[New comment by moefh in "Over 40% of deceased drivers in vehicle crashes test positive for THC: Study"]]></title><description><![CDATA[
<p>We don't know that. We don't even know if there's selection bias.<p>The article says the research was "focusing on 246 deceased drivers who were tested for THC", and that the test usually happens when autopsies are performed. It doesn't say if autopsies are performed for all driver deaths, and it also doesn't say what exactly is "usually".<p>If (for example) autopsy only happens when the driver is suspected of drug use, then there's a clear selection bias.<p>Note that this doesn't mean the study is useless: they were able to see that legalization of cannabis didn't have impact on recreational use.</p>
]]></description><pubDate>Sat, 20 Dec 2025 18:37:49 +0000</pubDate><link>https://news.ycombinator.com/item?id=46338410</link><dc:creator>moefh</dc:creator><comments>https://news.ycombinator.com/item?id=46338410</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=46338410</guid></item><item><title><![CDATA[New comment by moefh in "Checked-size array parameters in C"]]></title><description><![CDATA[
<p>> The fact that the correct type signature, a pointer to fixed-size array, exists and that you can create a struct containing a fixed-size array member and pass that in by value completely invalidates any possible argument for having special semantics for fixed-size array parameters.<p>That's not entirely accurate: "fixed-size" array parameters (unlike pointers to arrays or arrays in structs) actually say that the array must be <i>at least</i> that size, not exactly that size, which makes them way more flexible (e.g. you don't need a buffer of an exact size, it can be larger). The examples from the article are neat but fairly specific because cryptographic functions always work with pre-defined array sizes, unlike most algorithms.<p>Incidentally, that was one of the main complaints about Pascal back in the day (see section 2.1 of [1]): it originally had only fixed-size arrays and strings, with no way for a function to accept a "generic array" or a "generic string" with size unknown at compile time.<p>[1] <a href="https://www.cs.virginia.edu/~evans/cs655/readings/bwk-on-pascal.html" rel="nofollow">https://www.cs.virginia.edu/~evans/cs655/readings/bwk-on-pas...</a></p>
]]></description><pubDate>Thu, 04 Dec 2025 00:18:00 +0000</pubDate><link>https://news.ycombinator.com/item?id=46142178</link><dc:creator>moefh</dc:creator><comments>https://news.ycombinator.com/item?id=46142178</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=46142178</guid></item><item><title><![CDATA[New comment by moefh in "Checked-size array parameters in C"]]></title><description><![CDATA[
<p>It's not intuitive, although arguably conforms to the general C philosophy of not getting in the way unless the code has no chance of being right.<p>For example, both compilers do complain if you try to pass a literal NULL to `f1` (because that can't possibly be right), the same way they warn about division by a literal zero but give no warnings about dividing by a number that is not known to be nonzero.</p>
]]></description><pubDate>Wed, 03 Dec 2025 23:46:50 +0000</pubDate><link>https://news.ycombinator.com/item?id=46141896</link><dc:creator>moefh</dc:creator><comments>https://news.ycombinator.com/item?id=46141896</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=46141896</guid></item><item><title><![CDATA[New comment by moefh in "Checked-size array parameters in C"]]></title><description><![CDATA[
<p>It was always considered bad not (just) because it's ugly, but because it hides potential problems and adds no safety at all: a `[static N]` parameter tells the compiler that the parameter will never be NULL, but the function can still be called with a NULL pointer anyway.<p>That's is the current state of both gcc and clang: they will both happily, without warnings, pass a NULL pointer to a function with a `[static N]` parameter, and then REMOVE ANY NULL CHECK from the function, because the argument can't possibly be NULL according to the function signature, so the check is obviously redundant.<p>See the example in [1]: note that in the assembly of `f1` the NULL check is removed, while it's present in the "unsafe" `f2`, making it actually safer.<p>Also note that gcc will at least tell you that the check in `f1()` is "useless" (yet no warning about `g()` calling it with a pointer that could be NULL), while clang sees nothing wrong at all.<p>[1] <a href="https://godbolt.org/z/ba6rxc8W5" rel="nofollow">https://godbolt.org/z/ba6rxc8W5</a></p>
]]></description><pubDate>Wed, 03 Dec 2025 23:26:10 +0000</pubDate><link>https://news.ycombinator.com/item?id=46141723</link><dc:creator>moefh</dc:creator><comments>https://news.ycombinator.com/item?id=46141723</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=46141723</guid></item><item><title><![CDATA[New comment by moefh in "You can't fool the optimizer"]]></title><description><![CDATA[
<p>> It probably shouldn't do that if you create a dynamic library that needs a symbol table but for an ELF binary it could, no?<p>It can't do that because the program might load a dynamic library that depends on the function (it's perfectly OK for a `.so` to depend on a function from the main executable, for example).<p>That's one of the reasons why a very cheap optimization is to always use `static` for functions when you can. You're telling the compiler that the function doesn't need to be visible outside the current compilation unit, so the compiler is free to even inline it completely and never produce an actual callable function, if appropriate.</p>
]]></description><pubDate>Wed, 03 Dec 2025 13:05:00 +0000</pubDate><link>https://news.ycombinator.com/item?id=46134034</link><dc:creator>moefh</dc:creator><comments>https://news.ycombinator.com/item?id=46134034</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=46134034</guid></item><item><title><![CDATA[New comment by moefh in "New magnetic component discovered in the Faraday effect"]]></title><description><![CDATA[
<p>> Special Relativity (non-accelerating frames of reference, i.e. moving at a constant speed)<p>Sorry, but this is a pet peeve of mine: special relativity works perfectly well in accelerating frames of reference, as long as the spacetime remains flat (a Minkowski space[1]), for example when any curvature caused by gravity is small enough that you can ignore it.<p>[1] <a href="https://en.wikipedia.org/wiki/Minkowski_space" rel="nofollow">https://en.wikipedia.org/wiki/Minkowski_space</a></p>
]]></description><pubDate>Mon, 24 Nov 2025 15:31:34 +0000</pubDate><link>https://news.ycombinator.com/item?id=46035163</link><dc:creator>moefh</dc:creator><comments>https://news.ycombinator.com/item?id=46035163</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=46035163</guid></item></channel></rss>