<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: mrgriffin</title><link>https://news.ycombinator.com/user?id=mrgriffin</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Wed, 29 Apr 2026 08:08:06 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=mrgriffin" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by mrgriffin in "Mitigating the Billion Dollar Mistake"]]></title><description><![CDATA[
<p>I'm sure Bill understands what I'm about to say, but as a person on team "require explicit initializations" I think the mitigations I would be looking at are:<p>1. Only require that the programmer prove the variable is initialized before it's read. Riffing on Bill's example:<p><pre><code>    Object *x; // Fine
    if (is_foo) {
      x = &foo;
    } else {
      x = &bar;
    }
    x->a // Fine, was initialized by the time it was used.
</code></pre>
Of course this is still a trade-off, your compiler has to work harder to prove that all paths that flow to each use are definitely-initialized. When you have initialization functions you now need to have type specifiers like 'in', 'out', and 'in/out' so that 'out' can take a pointer to uninitialized data, or something like MaybeUninit. This handles this example from Bill:<p><pre><code>    Foo f;
    Bar b;
    grab_data(&f, &b); // Fine if 'grab_data(out Foo *, out Bar *)'.
</code></pre>
2. Something like Rust's MaybeUninit to explicitly opt-in to wanting to deal with possibly-uninitialized data. Obviously also a trade-off, especially if you want to force all the maybe uninitialized stuff to be in an 'unsafe' block.</p>
]]></description><pubDate>Mon, 12 Jan 2026 10:37:15 +0000</pubDate><link>https://news.ycombinator.com/item?id=46586606</link><dc:creator>mrgriffin</dc:creator><comments>https://news.ycombinator.com/item?id=46586606</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=46586606</guid></item><item><title><![CDATA[New comment by mrgriffin in "Stackful Coroutine Made Fast"]]></title><description><![CDATA[
<p>Making all registers caller-saved around context switches is a neat insight, it's intuitive how that could potentially lead to needing fewer instructions to execute when switching contexts.<p>I haven't yet digested exactly how the stacks are made to work. I think fig 8 should be obvious, but I'm getting stuck on picturing how the system guarantees that frame 1 can't grow into frame 2.<p>EDIT: Ah, I think I understand. It seems that they're taking advantage of a large virtual address space to give each stack loads of space, rather than them being contiguous like I assumed from fig 8.<p>> As modern 64-bit address-space is big enough for the allocation of many large continuous stacks [...]</p>
]]></description><pubDate>Tue, 28 Oct 2025 16:40:26 +0000</pubDate><link>https://news.ycombinator.com/item?id=45735158</link><dc:creator>mrgriffin</dc:creator><comments>https://news.ycombinator.com/item?id=45735158</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=45735158</guid></item><item><title><![CDATA[New comment by mrgriffin in "Microservices are a tax your startup probably can't afford"]]></title><description><![CDATA[
<p>> `foo :: Semigroup a, Traversable t => t a -> a` I already know that whatever is passed to this function can be traversed and have it's sum computed. It's impossible to pass something which doesn't satisfy both of those constraints as this is a specification given at the type level which is checked at compile-time.<p>To add to your point, I don't think foo can even be implemented (more accurately: is not total) because neither `Semigroup a` or `Traversable t` guarantee a way to get an `a`.<p>I think you'd need either `Monoid a` which has `mempty`, or `(Foldable1 t, Traversable t)` which guarantees that there's at least one `a` available.</p>
]]></description><pubDate>Fri, 09 May 2025 09:05:17 +0000</pubDate><link>https://news.ycombinator.com/item?id=43935031</link><dc:creator>mrgriffin</dc:creator><comments>https://news.ycombinator.com/item?id=43935031</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=43935031</guid></item><item><title><![CDATA[New comment by mrgriffin in "Detecting if an expression is constant in C"]]></title><description><![CDATA[
<p>Would you expect IS_CONST to evaluate to the constant? With a name like that I would expect it to evaluate to true/false.<p>C here is asserting that the value inside is a constant and then evaluating to that constant.</p>
]]></description><pubDate>Wed, 23 Apr 2025 08:06:13 +0000</pubDate><link>https://news.ycombinator.com/item?id=43769709</link><dc:creator>mrgriffin</dc:creator><comments>https://news.ycombinator.com/item?id=43769709</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=43769709</guid></item><item><title><![CDATA[New comment by mrgriffin in "Accessing a DRM Framebuffer to display an image"]]></title><description><![CDATA[
<p>> One very frustration aspect is that there is basically no real documentation<p>I looked at DRM/KMS briefly earlier in the year and this is what made me abandon it in the end. Can you recommend any sources of information?<p>The atomic API and "test only commit" both sound really useful.</p>
]]></description><pubDate>Sun, 08 Dec 2024 08:52:08 +0000</pubDate><link>https://news.ycombinator.com/item?id=42355921</link><dc:creator>mrgriffin</dc:creator><comments>https://news.ycombinator.com/item?id=42355921</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=42355921</guid></item><item><title><![CDATA[New comment by mrgriffin in "Union types ('enum types') would be complicated in Go"]]></title><description><![CDATA[
<p>> doesn't run against the grain of the entire language<p>Not an expert, but my gut says maybe it runs against zero values? As in, "what's the zero value for a non-nullable reference?" Maybe the answer is something like "you can only use this type for parameters", but that seems very limiting.</p>
]]></description><pubDate>Sat, 07 Dec 2024 09:00:48 +0000</pubDate><link>https://news.ycombinator.com/item?id=42348345</link><dc:creator>mrgriffin</dc:creator><comments>https://news.ycombinator.com/item?id=42348345</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=42348345</guid></item><item><title><![CDATA[New comment by mrgriffin in "Localisation is too hard for Gmail"]]></title><description><![CDATA[
<p>I think the person you're responding to is agreeing with you that you should optimize for languages other than English rather than for people naming a label "Bin" and then switching to the UK locale.</p>
]]></description><pubDate>Wed, 21 Oct 2020 16:11:22 +0000</pubDate><link>https://news.ycombinator.com/item?id=24849191</link><dc:creator>mrgriffin</dc:creator><comments>https://news.ycombinator.com/item?id=24849191</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=24849191</guid></item><item><title><![CDATA[New comment by mrgriffin in "A word for a value between 0 and 1 (inclusive)"]]></title><description><![CDATA[
<p>FWIW, that's not dependent typing, because the type doesn't depend on run-time values. A bool is either true or false, a [0...1] is either 0 or, ..., or 1.<p>As for which languages allow it. I'm not sure for floats, but Pascal let you do it for ints for sure. <a href="https://wiki.freepascal.org/subrange_types" rel="nofollow">https://wiki.freepascal.org/subrange_types</a></p>
]]></description><pubDate>Fri, 04 Sep 2020 10:38:41 +0000</pubDate><link>https://news.ycombinator.com/item?id=24373703</link><dc:creator>mrgriffin</dc:creator><comments>https://news.ycombinator.com/item?id=24373703</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=24373703</guid></item><item><title><![CDATA[New comment by mrgriffin in "Fast Fibonacci numbers using Monoids"]]></title><description><![CDATA[
<p>Please write a blog post!</p>
]]></description><pubDate>Thu, 23 Apr 2020 20:32:57 +0000</pubDate><link>https://news.ycombinator.com/item?id=22960969</link><dc:creator>mrgriffin</dc:creator><comments>https://news.ycombinator.com/item?id=22960969</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22960969</guid></item><item><title><![CDATA[New comment by mrgriffin in "Europe heroically defends itself against veggie burgers"]]></title><description><![CDATA[
<p>I'd probably find the name Natural Seitan misleading (i.e. mistakenly buy it thinking it was vegan), but calling it "Animal Seitan" would be perfectly acceptable/clear to me .</p>
]]></description><pubDate>Fri, 10 Apr 2020 12:23:24 +0000</pubDate><link>https://news.ycombinator.com/item?id=22832296</link><dc:creator>mrgriffin</dc:creator><comments>https://news.ycombinator.com/item?id=22832296</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22832296</guid></item><item><title><![CDATA[New comment by mrgriffin in "Why I’m Leaving Elm"]]></title><description><![CDATA[
<p>Forbid "\t* *\t"?</p>
]]></description><pubDate>Thu, 09 Apr 2020 20:55:19 +0000</pubDate><link>https://news.ycombinator.com/item?id=22827089</link><dc:creator>mrgriffin</dc:creator><comments>https://news.ycombinator.com/item?id=22827089</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22827089</guid></item><item><title><![CDATA[New comment by mrgriffin in "Why I’m Leaving Elm"]]></title><description><![CDATA[
<p>I wouldn't do it, but this works perfectly fine. The rule is "use tabs to indent blocks of code, use spaces to align within those blocks".<p><pre><code>  <TAB><TAB>function name(arg1, arg2,
  <TAB><TAB>              arg3)</code></pre></p>
]]></description><pubDate>Thu, 09 Apr 2020 18:14:06 +0000</pubDate><link>https://news.ycombinator.com/item?id=22825525</link><dc:creator>mrgriffin</dc:creator><comments>https://news.ycombinator.com/item?id=22825525</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22825525</guid></item><item><title><![CDATA[New comment by mrgriffin in "Why we need a book about naming"]]></title><description><![CDATA[
<p>What about implementing something like map for lists? You know literally nothing about the values and the function except for their types.<p><pre><code>    map :: (a -> b) -> [a] -> [b]
    map f [] = []
    map f (a:as) = f a : map f as
</code></pre>
Personally I don't see any reason to use longer names than f, a, and as because you can't add any additional information.<p>You might say "well I don't write code like that", and I don't have any answer for you. But I find I write a fair amount of generic code.</p>
]]></description><pubDate>Thu, 13 Feb 2020 10:45:28 +0000</pubDate><link>https://news.ycombinator.com/item?id=22316714</link><dc:creator>mrgriffin</dc:creator><comments>https://news.ycombinator.com/item?id=22316714</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22316714</guid></item><item><title><![CDATA[New comment by mrgriffin in "All Programming Languages are Wrong (2018)"]]></title><description><![CDATA[
<p>I'd probably think of Bool as being isomorphic to Maybe (), which would mean your map implementation looks a bit like:<p><pre><code>    map :: Bool -> (() -> b) -> Maybe b
    map True f = Just (f ())
    map False _ = Nothing
</code></pre>
Or, in Haskell because you've got laziness you could go with:<p><pre><code>    map :: Bool -> b -> Maybe b
</code></pre>
Which already exists as a combination of Control.Monad.guard and Data.Functor.(<$).<p><pre><code>    map tf b = b <$ guard tf</code></pre></p>
]]></description><pubDate>Wed, 12 Feb 2020 17:44:00 +0000</pubDate><link>https://news.ycombinator.com/item?id=22310865</link><dc:creator>mrgriffin</dc:creator><comments>https://news.ycombinator.com/item?id=22310865</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22310865</guid></item><item><title><![CDATA[New comment by mrgriffin in "API Practices If You Hate Your Customers"]]></title><description><![CDATA[
<p>I've gotta say, if I was a third party to the exchange that involved your suggested message I would think the senior developer was a pompous and condescending ass. In the UK we (or at least I) wouldn't consider what you wrote to be a polite response.</p>
]]></description><pubDate>Thu, 12 Dec 2019 10:20:23 +0000</pubDate><link>https://news.ycombinator.com/item?id=21770763</link><dc:creator>mrgriffin</dc:creator><comments>https://news.ycombinator.com/item?id=21770763</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=21770763</guid></item><item><title><![CDATA[New comment by mrgriffin in "How to play with people who are better than you"]]></title><description><![CDATA[
<p>I had meant to restrict my weight lifting comments to the kind of weight lifting that goes on in gyms (what was being discussed upthread). And I have to confess I don't know much about those sports you named, but do the participants really interact with each other like they would in, say basketball or soccer? Maybe there really is a rule like "there are a finite number of weights, and each can be lifted by at most one person", which would be pretty similar to "there's only one ball, therefore only the player with the ball can score"? And therefore being paired with someone who vastly outclasses you wrt lifting weights will effectively render you unable to participate (by taking all the weights you can lift, similar to taking 100% of the possessions of the ball).</p>
]]></description><pubDate>Wed, 04 Dec 2019 15:49:49 +0000</pubDate><link>https://news.ycombinator.com/item?id=21703161</link><dc:creator>mrgriffin</dc:creator><comments>https://news.ycombinator.com/item?id=21703161</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=21703161</guid></item><item><title><![CDATA[New comment by mrgriffin in "The most copied StackOverflow snippet of all time is flawed"]]></title><description><![CDATA[
<p>Don't many QuickCheck-inspired libraries have special cases to ensure they generate common numbers like those? I could be misremembering, but I would have sworn I read that in the documentation of the last library I looked at (whose name escapes me).</p>
]]></description><pubDate>Wed, 04 Dec 2019 13:36:39 +0000</pubDate><link>https://news.ycombinator.com/item?id=21702007</link><dc:creator>mrgriffin</dc:creator><comments>https://news.ycombinator.com/item?id=21702007</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=21702007</guid></item><item><title><![CDATA[New comment by mrgriffin in "How to play with people who are better than you"]]></title><description><![CDATA[
<p>That isn't a very good comparison. Lifting weights isn't a competition in the way that basketball is. I want to say the latter is more "zero-sum", but I'm not sure if that's correct terminology.</p>
]]></description><pubDate>Wed, 04 Dec 2019 12:03:58 +0000</pubDate><link>https://news.ycombinator.com/item?id=21701463</link><dc:creator>mrgriffin</dc:creator><comments>https://news.ycombinator.com/item?id=21701463</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=21701463</guid></item><item><title><![CDATA[New comment by mrgriffin in "How an Optimizing Compiler Works"]]></title><description><![CDATA[
<p>From the article:<p>> multiplied does not: it starts off 0, and every time it is multiplied via multiplied = multiplied * count it remains 0.<p>The article then goes on to use that fact for some optimizations.</p>
]]></description><pubDate>Tue, 12 Nov 2019 09:58:55 +0000</pubDate><link>https://news.ycombinator.com/item?id=21512910</link><dc:creator>mrgriffin</dc:creator><comments>https://news.ycombinator.com/item?id=21512910</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=21512910</guid></item><item><title><![CDATA[New comment by mrgriffin in "Parse, Don’t Validate"]]></title><description><![CDATA[
<p>You might be right, it's been a long time for me too. But if it <i>can</i> define new classes, then I'd expect that the code for those classes' methods would also be in the pickled format, at which point there's no particular reason you couldn't deserialize it in Haskell too... with some caveats about either needing to know what types those functions should have, or needing to build a run-time representation of those types so that they can be checked when called, or (hopefully!) crashing if you're okay with just unsafeCoercing things around.</p>
]]></description><pubDate>Fri, 08 Nov 2019 17:09:57 +0000</pubDate><link>https://news.ycombinator.com/item?id=21484261</link><dc:creator>mrgriffin</dc:creator><comments>https://news.ycombinator.com/item?id=21484261</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=21484261</guid></item></channel></rss>