<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: dgrunwald</title><link>https://news.ycombinator.com/user?id=dgrunwald</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Sat, 28 Nov 2026 06:40:27 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=dgrunwald" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by dgrunwald in "The need for a formally verifiable mainstream programming language"]]></title><description><![CDATA[
<p>> The most vulnerable part that will remain will be the formalization of requirements. That's impossible to solve fully because you never know what the human had in mind exactly when he ordered the program to be written.<p>I don't think it necessarily needs to be solved. You can combine formal verification with tests!
Use tests to show that the program occasionally does what you want.
Use verification to show that the program never does what you don't want (e.g. crash).
The formal requirements can be quite weak this way, yet you still get a high level of assurance overall.<p>And you'll be surprised how many invariants you'll actually need for the simple "don't crash" requirement -- to prove anything at all in a complex program, underlying components need to be correct, or it becomes hard/impossible to prove anything at all about the code using those components.<p>So (admittedly without any personal experience other than studying this area an university more than decade ago) I expect even a simple "don't crash" requirement gets you the majority of the formal verification benefits. (as long as you have some tests to ensure the implementation isn't just returning a constant)</p>
]]></description><pubDate>Fri, 27 Nov 2026 12:25:47 +0000</pubDate><link>https://news.ycombinator.com/item?id=50666121</link><dc:creator>dgrunwald</dc:creator><comments>https://news.ycombinator.com/item?id=50666121</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50666121</guid></item><item><title><![CDATA[New comment by dgrunwald in "The lost malloc()"]]></title><description><![CDATA[
<p>But it's possible for `delete tmp;` to call a user-defined `operator delete()` in the derived class! <a href="https://godbolt.org/z/hvePa6jMP" rel="nofollow">https://godbolt.org/z/hvePa6jMP</a><p>The way this works under the hood is that every polymorphic class has two destructors (so two destructor entries in the vtable): the "complete object destructor" is the ~A() you know from C++, and then there's also the "deleting destructor" which combines ~A() + delete.<p>So the deleting destructor can call free() while knowing the derived object size, even for a delete-via-base-class-pointer.</p>
]]></description><pubDate>Wed, 04 Nov 2026 16:50:41 +0000</pubDate><link>https://news.ycombinator.com/item?id=50368285</link><dc:creator>dgrunwald</dc:creator><comments>https://news.ycombinator.com/item?id=50368285</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50368285</guid></item><item><title><![CDATA[New comment by dgrunwald in "GitLab Security Incident: Attempted Exploitation of CVE-2026-97229"]]></title><description><![CDATA[
<p>Depends on what kind of exploitation you're talking about -- integer overflows can still cause out of memory conditions and crash the program, which is a denial-of-service vulnerability when talking about webapps.<p>But yes, memory-save languages like Rust are a massive help protecting against remote code execution. (unless said memory-safe language introduces its own category of RCE vulnerabilities, e.g. deserialization in Java)</p>
]]></description><pubDate>Thu, 29 Oct 2026 08:32:41 +0000</pubDate><link>https://news.ycombinator.com/item?id=50286040</link><dc:creator>dgrunwald</dc:creator><comments>https://news.ycombinator.com/item?id=50286040</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50286040</guid></item><item><title><![CDATA[New comment by dgrunwald in "Composite objects and C++26 the std:polymorphic type"]]></title><description><![CDATA[
<p>> It would've been much more useful to make the move constructor of indirect be deleted<p>No, that would be less useful.
As-is, you can use a class with a `std::indirect<T>` member in a `std::vector` just fine, thanks to the move constructor.<p>With `std::indirect` in `std::vector`, the vector can use move the `indirect` internally when reallocating, and as a user of the vector you will never encounter the moved-from state.<p>It's annoying that C++ doesn't have destructive move and thus needs to relax class invariants after a move happened, but in practice it's usually not a big deal because use-after-move is usually a bug, nothing anyone would do intentionally.</p>
]]></description><pubDate>Wed, 21 Oct 2026 08:27:54 +0000</pubDate><link>https://news.ycombinator.com/item?id=50177629</link><dc:creator>dgrunwald</dc:creator><comments>https://news.ycombinator.com/item?id=50177629</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50177629</guid></item><item><title><![CDATA[New comment by dgrunwald in "Security advisory: Critical remote code execution vulnerabilities, update now"]]></title><description><![CDATA[
<p>Are you forgetting about log4shell?<p>log4shell was easier to exploit.
It also come with an initial patch that turned out to be incomplete, so everyone had to urgently patch every java web app twice!</p>
]]></description><pubDate>Wed, 21 Oct 2026 06:58:26 +0000</pubDate><link>https://news.ycombinator.com/item?id=50177030</link><dc:creator>dgrunwald</dc:creator><comments>https://news.ycombinator.com/item?id=50177030</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50177030</guid></item><item><title><![CDATA[New comment by dgrunwald in "Valen's Memory Safety: A New Kind of Borrow Checking"]]></title><description><![CDATA[
<p>If a language allows taking references to fields within a tagged union (as is possible with Rust enums), then "shared-xor-mutable" is required to avoid use-after-free (switching the tagged union to another variant ends the lifetime of the old variant's fields).</p>
]]></description><pubDate>Mon, 12 Oct 2026 09:53:52 +0000</pubDate><link>https://news.ycombinator.com/item?id=50053945</link><dc:creator>dgrunwald</dc:creator><comments>https://news.ycombinator.com/item?id=50053945</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50053945</guid></item><item><title><![CDATA[New comment by dgrunwald in "Reducing undefined behavior in the C language"]]></title><description><![CDATA[
<p>A surprising number of those optimizations are only valid by "reasoning from undefined behavior".<p>Under the as-is rule, optimizations must not change program behavior.
A C program could theoretically use out-of-bounds pointers to scan its own stack, observing whether a value occurs on the stack. Thus, the as-is rule prohibits storing local variables in registers!<p>But because out-of-bounds pointers are undefined behavior, the compiler can ignore the programs doing stack scanning, and so register allocation becomes possible under the as-is.<p>So boring old register allocation is one of those "assume that UB doesn't happen" optimizations! Of course, the compiler never actually reasons "this pointer arithmetic is out of bounds therefore I can put that variable over there into a register" -- the reasoning from undefined behavior doesn't happen at compile-time, it already happened when the "register allocation" optimization was designed. But that's the case for most "assume that UB doesn't happen" optimizations!
(this is also why it's so difficult for compilers to warn about undefined behavior -- they optimize based on it without ever detecting it!)<p>If you want to eliminate "reasoning from undefined behavior", you'd also need to replace the "as-is" rule with something else -- an explicit list of allowed optimizations in the language standard?</p>
]]></description><pubDate>Fri, 09 Oct 2026 08:26:01 +0000</pubDate><link>https://news.ycombinator.com/item?id=50017628</link><dc:creator>dgrunwald</dc:creator><comments>https://news.ycombinator.com/item?id=50017628</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50017628</guid></item><item><title><![CDATA[New comment by dgrunwald in "Reducing undefined behavior in the C language"]]></title><description><![CDATA[
<p>> I honestly don't really care how many optimizations that would break; correctness is king.<p>It's approximately all optimizations.
Good news: there's already a compiler option that does exactly what you want: -O0.
It's even enabled by default (unless overridden by another -O switch)!</p>
]]></description><pubDate>Fri, 09 Oct 2026 08:04:01 +0000</pubDate><link>https://news.ycombinator.com/item?id=50017476</link><dc:creator>dgrunwald</dc:creator><comments>https://news.ycombinator.com/item?id=50017476</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50017476</guid></item><item><title><![CDATA[New comment by dgrunwald in "Reducing undefined behavior in the C language"]]></title><description><![CDATA[
<p>The compiler is only allowed to do that when it can prove `puts` will return (i.e. it must prove `puts` does not call `exit`). In a world with SIGPIPE that shouldn't happen. (unless maybe the compiler can prove that there's enough space available in the stdlib IO buffers so that puts won't actually output anything. but then there's no obversable difference in behavior)</p>
]]></description><pubDate>Fri, 09 Oct 2026 07:03:23 +0000</pubDate><link>https://news.ycombinator.com/item?id=50017049</link><dc:creator>dgrunwald</dc:creator><comments>https://news.ycombinator.com/item?id=50017049</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50017049</guid></item><item><title><![CDATA[New comment by dgrunwald in "EDG C++ front-end goes public"]]></title><description><![CDATA[
<p>Despite using C++ for a few years now, the EDG source code is still mostly C code (and in fact, the C++ code is still using the old .c file names). In particular, there's no usage of the C++ standard library.<p>Where other languages might use inheritance, EDG still uses the C-style `union { ... } variant;`.<p>On a related note, compiling EDG is extremely fast: on my machine, the EDG frontend compiles in <10s; whereas clang takes >10min (caution unfair comparison: clang includes much more than just a frontend).</p>
]]></description><pubDate>Wed, 30 Sep 2026 20:20:32 +0000</pubDate><link>https://news.ycombinator.com/item?id=49913815</link><dc:creator>dgrunwald</dc:creator><comments>https://news.ycombinator.com/item?id=49913815</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49913815</guid></item><item><title><![CDATA[New comment by dgrunwald in "EDG C++ front-end goes public"]]></title><description><![CDATA[
<p>It's one of the 4 big remaining C++ compiler frontends: gcc, clang, MSVC, EDG.
Most other C++ compilers are based on either EDG or clang. (e.g. the Intel C++ compiler used to be based on the EDG frontend, though modern versions are based on clang instead)<p>The "frontend" is the part of the compiler that understands the input language: lexer, parser, template instantiation, constexpr evaluation, ...
The EDG frontend produces an intermediate representation (IL) that is then used by the different compiler vendors to generate machine code. Or do code analysis.<p>EDG can also be used as a C++-to-C compiler.</p>
]]></description><pubDate>Wed, 30 Sep 2026 19:44:05 +0000</pubDate><link>https://news.ycombinator.com/item?id=49913343</link><dc:creator>dgrunwald</dc:creator><comments>https://news.ycombinator.com/item?id=49913343</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49913343</guid></item><item><title><![CDATA[New comment by dgrunwald in "C's Flexible Integer Sizes Were Not a Design Mistake"]]></title><description><![CDATA[
<p>> ILP64 (wherein int is 64 bits) exists. It's not very popular, but it exists; e.g. ICC supports it.<p>ILP64 is problematic for existing code: there is lots of stuff like hashcode computations using uint32_t with multiplications, relying on the C standard guaranteeing wraparound for unsigned overflows.
But with 64-bit int, uint32_t will promote to a signed int, and overflows will thus be undefined behavior.
This problem already exists with uint16_t multiplications on current architectures, but moving the problem to uint32_t will cause trouble for a lot of existing code that thought using fixed-size types like uint32_t would be safe.</p>
]]></description><pubDate>Sun, 27 Sep 2026 19:56:51 +0000</pubDate><link>https://news.ycombinator.com/item?id=49870233</link><dc:creator>dgrunwald</dc:creator><comments>https://news.ycombinator.com/item?id=49870233</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49870233</guid></item><item><title><![CDATA[New comment by dgrunwald in "Subnormal floating-point numbers are expensive on Intel processors"]]></title><description><![CDATA[
<p>For 32-bit floats, subnormals are the numbers closer to 0 than 2**(-126) == 0.0000000000000000000000000000000000000117549.
For 64-bit doubles, it's 2**(-1022), a number starting with 308 decimal zeroes.</p>
]]></description><pubDate>Fri, 18 Sep 2026 14:46:37 +0000</pubDate><link>https://news.ycombinator.com/item?id=49755174</link><dc:creator>dgrunwald</dc:creator><comments>https://news.ycombinator.com/item?id=49755174</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49755174</guid></item><item><title><![CDATA[New comment by dgrunwald in "Move in C++ without a std:move"]]></title><description><![CDATA[
<p>I don't know why I wrote the comment about parameters earlier -- (N)RVO is about return values.
Those have a different reason for being passed behind a hidden pointer: the class type might have self-referencing pointers, so there must be an explicit move/copy constructor call whenever it changes address, to give the class an opportunity to update those pointers. This cannot work when returning in a register: the callee doesn't know the target address, and the caller doesn't the source address, so neither can call the move constructor.
Thus, all ABIs <i>must</i> pass a pointer (or let caller+callee agree on a memory location in some other way) for types that aren't trivially copyable.</p>
]]></description><pubDate>Fri, 04 Sep 2026 16:52:29 +0000</pubDate><link>https://news.ycombinator.com/item?id=49567121</link><dc:creator>dgrunwald</dc:creator><comments>https://news.ycombinator.com/item?id=49567121</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49567121</guid></item><item><title><![CDATA[New comment by dgrunwald in "Six curl CVEs after OpenAI and Anthropic came back with zero"]]></title><description><![CDATA[
<p>> Memory safety bugs aren't any different from other bugs.<p>This is highly dependent on what kind of software you are writing.<p>On the one end, there's stuff like an image format parser in a browser -- a pure function from untrusted bytes to untrusted pixels.
In a memory-safe language, it's pretty hard for such code to have vulnerabilities (other than DoS) in such code -- you'd have to explicitly go out of your way to do weird stuff (open unrelated files, start subprocesses, ...). Simple logic bugs can only lead the wrong pixels or panics. But when memory safety bugs are possible, remote code execution is common in such code. Memory-safe languages make a massive difference here!<p>On the other end, you have stuff like a javascript JIT compiler, which turns untrusted javascript into trusted machine code -- here pretty much any logic bug leading to "wrong output" can be turned into a remote code execution exploit. Memory safe languages are not very useful here.</p>
]]></description><pubDate>Thu, 03 Sep 2026 20:24:59 +0000</pubDate><link>https://news.ycombinator.com/item?id=49556376</link><dc:creator>dgrunwald</dc:creator><comments>https://news.ycombinator.com/item?id=49556376</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49556376</guid></item><item><title><![CDATA[New comment by dgrunwald in "Move in C++ without a std:move"]]></title><description><![CDATA[
<p>The optimization is often possible even if the computer does not see the call, because most (all?) ABIs have <i>always</i> required hidden pointer parameters for class types with non-trivial destructors.<p><a href="https://godbolt.org/z/9WvnEvEYh" rel="nofollow">https://godbolt.org/z/9WvnEvEYh</a>
Note how `std::unique_ptr<int>` effectively passed as a `int**`; and that the by-value unique_ptr is not destroyed at the end of the function -- destroying parameters is instead the caller's job (and commonly only happens at the end of the full expression containing the call -- though this choice is implementation-defined).
But that can only work if the caller can see the updated value of the parameter (to avoid double-free for `clear`) -> thus the need to pass the parameter by hidden pointer.</p>
]]></description><pubDate>Wed, 02 Sep 2026 14:01:38 +0000</pubDate><link>https://news.ycombinator.com/item?id=49536398</link><dc:creator>dgrunwald</dc:creator><comments>https://news.ycombinator.com/item?id=49536398</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49536398</guid></item><item><title><![CDATA[New comment by dgrunwald in "I used Fable to rewrite 65kLoC of Go in Rust. It cost $400"]]></title><description><![CDATA[
<p>The compiler cannot optimize that into `while(true)` because the original code does not encounter undefined behavior when `limit` is small enough to fit into `int`.
What it can do: infer that `limit <= INT_MAX` and use that to optimize the code following after the loop (and in some cases, even the code before the loop).</p>
]]></description><pubDate>Wed, 02 Sep 2026 11:42:22 +0000</pubDate><link>https://news.ycombinator.com/item?id=49534834</link><dc:creator>dgrunwald</dc:creator><comments>https://news.ycombinator.com/item?id=49534834</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49534834</guid></item><item><title><![CDATA[New comment by dgrunwald in "Malicious Rust crate Arrayref runs a build-time payload"]]></title><description><![CDATA[
<p>The malicious code could use life-before-main hacks to gain code execution if it's linked at all, even if uncalled.
<a href="https://grack.com/blog/2026/06/11/life-before-main/" rel="nofollow">https://grack.com/blog/2026/06/11/life-before-main/</a></p>
]]></description><pubDate>Thu, 20 Aug 2026 18:58:41 +0000</pubDate><link>https://news.ycombinator.com/item?id=49378691</link><dc:creator>dgrunwald</dc:creator><comments>https://news.ycombinator.com/item?id=49378691</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49378691</guid></item><item><title><![CDATA[New comment by dgrunwald in "Linux kernel will support $ORIGIN, sort of"]]></title><description><![CDATA[
<p>$ORIGIN was only supported when the loader was looking for other dependencies.
The loader itself (field PT_INTERP) is loaded by the kernel. So prior to this change, every program must hardcode the absolute path to ld.so.
With support for an $ORIGIN-relative loader, each program could use its own copy of ld.so.</p>
]]></description><pubDate>Tue, 21 Jul 2026 07:48:29 +0000</pubDate><link>https://news.ycombinator.com/item?id=48989331</link><dc:creator>dgrunwald</dc:creator><comments>https://news.ycombinator.com/item?id=48989331</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48989331</guid></item><item><title><![CDATA[New comment by dgrunwald in "Do you hate XML? (2010)"]]></title><description><![CDATA[
<p>> Furthermore parsing JSON or YAML gives you the basic data types like lists and dictionaries. Parsing XML gives you an AST that requires a lot more effort to turn into data in your domain.<p>More precisely: in XML, elements (nodes) are named/labeled. ("node-labeled graph")
In JSON, keys (edges) are named. ("edge-labeled graph")<p>In programming, we need names for the fields in our structures (edges between objects), so JSON is a much better match than XML (which needs contortions to handle this use case -- e.g. by having nesting levels alternate between element=node and element=edge).
Only in some object-oriented cases (which derived class should the deserializer construct?) do you care about node labels -- but usually that's in addition to edge labels, so a "_type" key in JSON is still easier than XML.</p>
]]></description><pubDate>Sun, 05 Jul 2026 20:01:28 +0000</pubDate><link>https://news.ycombinator.com/item?id=48797476</link><dc:creator>dgrunwald</dc:creator><comments>https://news.ycombinator.com/item?id=48797476</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48797476</guid></item></channel></rss>