<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: MaxBarraclough</title><link>https://news.ycombinator.com/user?id=MaxBarraclough</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Thu, 04 Jun 2026 09:12:35 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=MaxBarraclough" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by MaxBarraclough in "Asserts in Zig"]]></title><description><![CDATA[
<p>> DbC is the Policy (i.e. what/why) and Asserts are the Mechanism<p>The ideal way to do runtime-checked DbC is not with simple asserts, it's with proper first-class preconditions and postconditions at the language level.<p>It wouldn't be nice to have to manually ensure that both old and new states of variables are in-scope for postcondition checking. I can imagine that being not just tedious, but error-prone.<p>> An Assert merely validates the state of a program at a particular point during execution.<p>Some aspect of the program's state, yes, and hopefully that's all it does.<p>Interesting to think about the edge-cases here though. Depending on the language, it could accidentally side-effect, or even invoke undefined behaviour, and so actively derail the program. Can't blame DbC for that though, that's a question of language safety.<p>> You use it to steer the program to go through only the correct subset of the state space of the program<p>I'm not sure I follow here. You don't use asserts to steer flow-control, you use them to check aspects of program state.<p>> You could do this pre/post every executable statement (i.e. write proof of correctness)<p>That doesn't constitute a proof of correctness, no more than last time you and I discussed this. [0] Depending on the language, it wouldn't even necessarily prove the correctness of that particular trace, as you haven't proven that you haven't accidentally invoked undefined behaviour.<p>You hold a minority opinion on this, please stop presenting it as settled fact.<p>> The point is that when using asserts you think about correctness w.r.t. specifications and nothing else. To think of it as simply validating arguments or in terms of effects on optimization is quite the wrong thing to do.<p>I'm not sure why you'd think I don't already know that.<p>[0] <a href="https://news.ycombinator.com/item?id=44675668">https://news.ycombinator.com/item?id=44675668</a></p>
]]></description><pubDate>Wed, 03 Jun 2026 21:04:37 +0000</pubDate><link>https://news.ycombinator.com/item?id=48390016</link><dc:creator>MaxBarraclough</dc:creator><comments>https://news.ycombinator.com/item?id=48390016</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48390016</guid></item><item><title><![CDATA[New comment by MaxBarraclough in "Asserts in Zig"]]></title><description><![CDATA[
<p>There's more to design-by-contract than asserts, and DbC isn't the only way to use asserts. Most languages lack proper support for design-by-contract.<p>(For what it's worth I didn't downvote you.)</p>
]]></description><pubDate>Tue, 02 Jun 2026 21:16:57 +0000</pubDate><link>https://news.ycombinator.com/item?id=48376435</link><dc:creator>MaxBarraclough</dc:creator><comments>https://news.ycombinator.com/item?id=48376435</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48376435</guid></item><item><title><![CDATA[New comment by MaxBarraclough in "KDE at 30"]]></title><description><![CDATA[
<p>> and it's open source because KDE's license made it that way<p>Chromium is open source, but Chrome isn't. Blink, WebKit, and for that matter KHTML, are available under permissive licences.</p>
]]></description><pubDate>Tue, 02 Jun 2026 21:07:57 +0000</pubDate><link>https://news.ycombinator.com/item?id=48376308</link><dc:creator>MaxBarraclough</dc:creator><comments>https://news.ycombinator.com/item?id=48376308</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48376308</guid></item><item><title><![CDATA[New comment by MaxBarraclough in "Int a = 5; a = a++ + ++a; a =? (2011)"]]></title><description><![CDATA[
<p>> Apparently signed integer overflow UB helps with loop optimizations because it makes it easy to prove the loop always terminates<p>I tried googling but couldn't find hard numbers on the performance impact of GCC's <i>-fwrapv</i> flag. As you'd imagine, it forces wrapping for overflowing arithmetic on signed integer types. [0]<p>I also have to wonder how instructive that would be anyway. The GCC devs presumably don't prioritise the performance impact of that flag. If the C language mandated it, they might find other ways to achieve similar optimisation.<p>This page [1] looks at the related flag for trap-on-signed-overflow, and found an impact of very roughly 6%.<p>See also: John Regehr's posts on this topic. [2][3] He dislikes Java's implicit wrap behaviour, as it's rarely what the programmer wants to happen. Java programmers almost never use the <i>addExact</i> method, [4] as it's so syntactically clumsy.<p>> surely it's UB because some systems trapped on overflow, or produced different results due to using 1's complement, and the optimization side of the rule was a happy accident<p>Per this StackOverflow answer [5] I think you have it right.<p>[0] <a href="https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html" rel="nofollow">https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html</a><p>[1] <a href="https://danluu.com/integer-overflow/" rel="nofollow">https://danluu.com/integer-overflow/</a><p>[2] <a href="https://blog.regehr.org/archives/1401" rel="nofollow">https://blog.regehr.org/archives/1401</a><p>[3] <a href="https://blog.regehr.org/archives/1154" rel="nofollow">https://blog.regehr.org/archives/1154</a><p>[4] <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Math.html#addExact(int,int)" rel="nofollow">https://docs.oracle.com/en/java/javase/25/docs/api/java.base...</a><p>[5] <a href="https://stackoverflow.com/a/18195756" rel="nofollow">https://stackoverflow.com/a/18195756</a></p>
]]></description><pubDate>Sun, 17 May 2026 13:41:10 +0000</pubDate><link>https://news.ycombinator.com/item?id=48168846</link><dc:creator>MaxBarraclough</dc:creator><comments>https://news.ycombinator.com/item?id=48168846</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48168846</guid></item><item><title><![CDATA[New comment by MaxBarraclough in "Int a = 5; a = a++ + ++a; a =? (2011)"]]></title><description><![CDATA[
<p>> It's worse than that, the behavior of the entire program is unconstrained by the language standard beforehand too. Raymond Chen discusses how things can go wrong once you're going to reach UB even before you get to it<p>Heh, yes that's exactly what I was thinking when I put <i>roughly speaking</i>.<p>> where a kind C compiler might just mess with your numbers a bit, an evil C compiler can legally make demons fly out of your nose<p>Yes, signed integer overflow being another. Presumably it's defined that way as it's simpler than trying to spell out all the behaviours the compiler is permitted to implement, and on top of that there are trap representations to worry about. I doubt modern compilers get much optimization benefit from it though. There's a StackOverflow thread discussing the reasons it's defined this way: <a href="https://stackoverflow.com/q/1860461" rel="nofollow">https://stackoverflow.com/q/1860461</a></p>
]]></description><pubDate>Sat, 16 May 2026 08:25:47 +0000</pubDate><link>https://news.ycombinator.com/item?id=48158068</link><dc:creator>MaxBarraclough</dc:creator><comments>https://news.ycombinator.com/item?id=48158068</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48158068</guid></item><item><title><![CDATA[New comment by MaxBarraclough in "Int a = 5; a = a++ + ++a; a =? (2011)"]]></title><description><![CDATA[
<p>> The fact that the ordering of those more primitive operations with respect to other operations isn't very tightly constrained is something you'd just have to know about the language, I suppose.<p>No, that's not right. It's undefined behaviour, not merely an unspecified order of evaluation. Roughly speaking, the behaviour of the entire program is unconstrained by the language standard after execution of that statement. It could crash the whole process, for instance, or go haywire.<p>(Again, that's in C, apparently, but not in C++.)</p>
]]></description><pubDate>Fri, 15 May 2026 21:19:53 +0000</pubDate><link>https://news.ycombinator.com/item?id=48154031</link><dc:creator>MaxBarraclough</dc:creator><comments>https://news.ycombinator.com/item?id=48154031</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48154031</guid></item><item><title><![CDATA[New comment by MaxBarraclough in "Int a = 5; a = a++ + ++a; a =? (2011)"]]></title><description><![CDATA[
<p>That isn't a strong answer, unless the question was about what you think of the code's style. The point is that it's more than just poor style, it's likely to constitute undefined behaviour. Saying different compilers could interpret the expression differently is not equivalent to saying it invokes undefined behaviour.<p>It's common for interview questions to explore unusual code, perhaps poor quality code, that hinges on edge cases of the language. A candidate with a strong understanding of the language would be expected to take the opportunity to demonstrate it.</p>
]]></description><pubDate>Fri, 15 May 2026 21:15:15 +0000</pubDate><link>https://news.ycombinator.com/item?id=48153961</link><dc:creator>MaxBarraclough</dc:creator><comments>https://news.ycombinator.com/item?id=48153961</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48153961</guid></item><item><title><![CDATA[New comment by MaxBarraclough in "If AI writes your code, why use Python?"]]></title><description><![CDATA[
<p>You might be interested in OpenJDK's new ability to 'cache' classes to accelerate class loading. <i>JEP 483: Ahead-of-Time Class Loading & Linking</i>. It doesn't persist code generated by the JIT, but can improve startup time appreciably.<p>From <a href="https://openjdk.org/jeps/483" rel="nofollow">https://openjdk.org/jeps/483</a> :<p>> <i>This program runs in 0.031 seconds on JDK 23. After doing the small amount of additional work required to create an AOT cache it runs in in 0.018 seconds on JDK 24 — an improvement of 42%.</i></p>
]]></description><pubDate>Fri, 15 May 2026 20:51:53 +0000</pubDate><link>https://news.ycombinator.com/item?id=48153641</link><dc:creator>MaxBarraclough</dc:creator><comments>https://news.ycombinator.com/item?id=48153641</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48153641</guid></item><item><title><![CDATA[New comment by MaxBarraclough in "Int a = 5; a = a++ + ++a; a =? (2011)"]]></title><description><![CDATA[
<p>> Having an understanding of how the code gets transformed into machine code helps<p>I'm not sure about that. Knowing assembly is not a substitute for knowing how the language is defined. Sometimes C/C++  programmers with some assembly knowledge reason themselves into thinking that what they're asking of the language must have well-defined behaviour, when in fact it's undefined behaviour.  It doesn't really matter whether interleaving order can change the output. <i>(++i)++</i> is, apparently [0], undefined behaviour in C but has well defined behaviour in C++.<p>[0] <a href="https://stackoverflow.com/a/58841107" rel="nofollow">https://stackoverflow.com/a/58841107</a></p>
]]></description><pubDate>Thu, 14 May 2026 21:27:23 +0000</pubDate><link>https://news.ycombinator.com/item?id=48141503</link><dc:creator>MaxBarraclough</dc:creator><comments>https://news.ycombinator.com/item?id=48141503</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48141503</guid></item><item><title><![CDATA[New comment by MaxBarraclough in "Cost of enum-to-string: C++26 reflection vs. the old ways"]]></title><description><![CDATA[
<p>I've not been diligently keeping up with C++ recently but there's a C++20 feature called <i>modules</i>. Per Wikipedia, they're somewhat like precompiled headers.<p><a href="https://en.wikipedia.org/wiki/Modules_(C%2B%2B)" rel="nofollow">https://en.wikipedia.org/wiki/Modules_(C%2B%2B)</a></p>
]]></description><pubDate>Thu, 14 May 2026 20:56:23 +0000</pubDate><link>https://news.ycombinator.com/item?id=48141126</link><dc:creator>MaxBarraclough</dc:creator><comments>https://news.ycombinator.com/item?id=48141126</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48141126</guid></item><item><title><![CDATA[New comment by MaxBarraclough in "Princeton mandates proctoring for in-person exams, upending 133 year precedent"]]></title><description><![CDATA[
<p>> If they cheat in classes, they are really just cheating themselves, and this should be no concern to the staff.<p>This is quite plainly not the case. If curve grading is used, cheating directly harms other students who aren't cheating. If curve grading isn't used, the university may end up handing out high grades like candy, and that's a problem for the university.<p>Higher grades can translate to better career outcomes even if undeserved. If it were clear that this wasn't the case, nobody would cheat in the first place.</p>
]]></description><pubDate>Thu, 14 May 2026 20:51:53 +0000</pubDate><link>https://news.ycombinator.com/item?id=48141072</link><dc:creator>MaxBarraclough</dc:creator><comments>https://news.ycombinator.com/item?id=48141072</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48141072</guid></item><item><title><![CDATA[New comment by MaxBarraclough in "If AI writes your code, why use Python?"]]></title><description><![CDATA[
<p><i>Strong typing</i> is not a synonym for <i>static typing</i>, it refers to a different aspect of type safety.<p>Static typing is, roughly, where variables and expressions have fixed types that can be determined ahead of execution. Strong typing means the language doesn't offer implicit type conversions. Python is dynamically typed, i.e. not statically typed, and strongly typed. (Ignoring its type annotations feature, of course.)</p>
]]></description><pubDate>Tue, 12 May 2026 20:10:26 +0000</pubDate><link>https://news.ycombinator.com/item?id=48113796</link><dc:creator>MaxBarraclough</dc:creator><comments>https://news.ycombinator.com/item?id=48113796</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48113796</guid></item><item><title><![CDATA[New comment by MaxBarraclough in "If AI writes your code, why use Python?"]]></title><description><![CDATA[
<p>> Concise since you have to review a lot more code<p>Isn't readability what matters here? Conciseness isn't the same thing.</p>
]]></description><pubDate>Mon, 11 May 2026 21:26:49 +0000</pubDate><link>https://news.ycombinator.com/item?id=48100895</link><dc:creator>MaxBarraclough</dc:creator><comments>https://news.ycombinator.com/item?id=48100895</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48100895</guid></item><item><title><![CDATA[New comment by MaxBarraclough in "I returned to AWS and was reminded why I left"]]></title><description><![CDATA[
<p>> OSS licensing. Free Software was designed to avoid this<p>This is pretty much a distinction without a difference. There are licences that qualify as one but not the other (per the FSF and OSI's determinations), but none are in widespread use.<p>> When you fork Free Software, your fork is also Free Software.<p>That would be <i>copyleft</i>. [0] Not all Free Software licences are copyleft licences.<p>[0] <a href="https://en.wikipedia.org/wiki/Copyleft" rel="nofollow">https://en.wikipedia.org/wiki/Copyleft</a></p>
]]></description><pubDate>Mon, 11 May 2026 21:12:26 +0000</pubDate><link>https://news.ycombinator.com/item?id=48100757</link><dc:creator>MaxBarraclough</dc:creator><comments>https://news.ycombinator.com/item?id=48100757</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48100757</guid></item><item><title><![CDATA[New comment by MaxBarraclough in "Stop MitM on the first SSH connection, on any VPS or cloud provider"]]></title><description><![CDATA[
<p>> Fingerprints are derived from the certificates/private keys<p>SSH fingerprints are derived from the <i>public</i> key. <a href="https://superuser.com/a/453022" rel="nofollow">https://superuser.com/a/453022</a></p>
]]></description><pubDate>Mon, 11 May 2026 20:45:40 +0000</pubDate><link>https://news.ycombinator.com/item?id=48100430</link><dc:creator>MaxBarraclough</dc:creator><comments>https://news.ycombinator.com/item?id=48100430</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48100430</guid></item><item><title><![CDATA[New comment by MaxBarraclough in "I’m spending months coding the old way"]]></title><description><![CDATA[
<p>The improved register count must make it much less claustrophobic for students. It's not just the same ISA but with wider words.<p>Looks like I'm mistaken on terminology though. <i>x86</i> includes the 16-bit, 32-bit, and 64-bit ISAs of that family, and doesn't refer specifically to the 32-bit generation.</p>
]]></description><pubDate>Sat, 18 Apr 2026 16:23:00 +0000</pubDate><link>https://news.ycombinator.com/item?id=47817102</link><dc:creator>MaxBarraclough</dc:creator><comments>https://news.ycombinator.com/item?id=47817102</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47817102</guid></item><item><title><![CDATA[New comment by MaxBarraclough in "I’m spending months coding the old way"]]></title><description><![CDATA[
<p>Can't imagine anyone teaching x86 assembly these days, did you mean x86-64?</p>
]]></description><pubDate>Sat, 18 Apr 2026 09:40:00 +0000</pubDate><link>https://news.ycombinator.com/item?id=47814540</link><dc:creator>MaxBarraclough</dc:creator><comments>https://news.ycombinator.com/item?id=47814540</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47814540</guid></item><item><title><![CDATA[New comment by MaxBarraclough in "Lean proved this program correct; then I found a bug"]]></title><description><![CDATA[
<p>Agreed, it's subtle but it's definitely a form of clickbait-style writing.</p>
]]></description><pubDate>Tue, 14 Apr 2026 21:30:22 +0000</pubDate><link>https://news.ycombinator.com/item?id=47771763</link><dc:creator>MaxBarraclough</dc:creator><comments>https://news.ycombinator.com/item?id=47771763</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47771763</guid></item><item><title><![CDATA[New comment by MaxBarraclough in "JVM Options Explorer"]]></title><description><![CDATA[
<p>Don't forget the Intel floating-point division bug from the 90s.<p><a href="https://en.wikipedia.org/wiki/Pentium_FDIV_bug" rel="nofollow">https://en.wikipedia.org/wiki/Pentium_FDIV_bug</a></p>
]]></description><pubDate>Sun, 12 Apr 2026 17:19:38 +0000</pubDate><link>https://news.ycombinator.com/item?id=47742143</link><dc:creator>MaxBarraclough</dc:creator><comments>https://news.ycombinator.com/item?id=47742143</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47742143</guid></item><item><title><![CDATA[New comment by MaxBarraclough in "Firm boosts H.264 streaming license fees from $100k up to staggering $4.5M"]]></title><description><![CDATA[
<p>Seems unlikely, migrating away from an entrenched codec like H264 isn't like a routine software update. It has widespread hardware support, and there's an enormous body of H264 video out there.<p>As <i>fhn</i> points out, there are now truly open video codecs available (open specification, royalty free, unencumbered by patent terms) that are able to compete with the patent-encumbered ones on technical merit. Seems curious that the patent-holders would want to hike prices in this way and validate the motivation behind the truly open codecs.<p>Also, the article mentions the licensing fees for H265 were also increased recently. It doesn't seem to give a figure, a quick web search turns up 25% [0] or perhaps 20% [1]. Perhaps I'm missing something obvious but I'm not clear on how the change in price relates to the patent dispute between Nokia and certain laptop manufacturers.<p>(It seems the H264 fee increase affects streaming providers only, whereas the H265 fee increase did not, as it affected laptop manufacturers.)<p>[0] <a href="https://news.ycombinator.com/item?id=46004129">https://news.ycombinator.com/item?id=46004129</a><p>[1] <a href="https://news.ycombinator.com/item?id=46003285">https://news.ycombinator.com/item?id=46003285</a></p>
]]></description><pubDate>Sat, 04 Apr 2026 10:06:50 +0000</pubDate><link>https://news.ycombinator.com/item?id=47637659</link><dc:creator>MaxBarraclough</dc:creator><comments>https://news.ycombinator.com/item?id=47637659</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47637659</guid></item></channel></rss>