<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: queoahfh</title><link>https://news.ycombinator.com/user?id=queoahfh</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Sat, 11 Jul 2026 20:54:41 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=queoahfh" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by queoahfh in "Postgres rewritten in Rust, now passing 100% of the Postgres regression tests"]]></title><description><![CDATA[
<p>I wrongly guessed that the boolean in the original C code was for error handling when I skimmed it, but instead it is just a result value, while elog() and related macros/functions are used for general error handling in the C version. I agree that it makes sense in Rust and other languages with tagged unions.<p>Though often when applicable, a simple tagged union is used instead when that would document the intention better. Like, the Rust version of search_pg_class_full_form::call() returns a Some for cache hit and None for cache miss as far as I can skim, and that group of methods returning that could arguably have returned a basic enum instead with CacheHit(value) and CacheMiss. Though this is a nitpick on my part.</p>
]]></description><pubDate>Thu, 09 Jul 2026 10:58:46 +0000</pubDate><link>https://news.ycombinator.com/item?id=48843884</link><dc:creator>queoahfh</dc:creator><comments>https://news.ycombinator.com/item?id=48843884</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48843884</guid></item><item><title><![CDATA[New comment by queoahfh in "Postgres rewritten in Rust, now passing 100% of the Postgres regression tests"]]></title><description><![CDATA[
<p>Yes, but the original boolean seems to have been used for error handling, and the tagged union is also used for error handling. Why have both simultaneously in the same function instead of just one of the two?<p>Edit: Looking at the code again, perhaps I was mistaken, since the boolean might not have been for error handling, just the result of the function, and C's limitations regarding error handling led it to using something like elog(), apparently a macro defined in <a href="https://github.com/postgres/postgres/blob/master/src/include/utils/elog.h" rel="nofollow">https://github.com/postgres/postgres/blob/master/src/include...</a> .</p>
]]></description><pubDate>Thu, 09 Jul 2026 08:32:59 +0000</pubDate><link>https://news.ycombinator.com/item?id=48842707</link><dc:creator>queoahfh</dc:creator><comments>https://news.ycombinator.com/item?id=48842707</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48842707</guid></item><item><title><![CDATA[New comment by queoahfh in "Postgres rewritten in Rust, now passing 100% of the Postgres regression tests"]]></title><description><![CDATA[
<p>I am concerned about the quality. Even a cursory skim of the code makes the code appear asinine. Unless the genius aspects of the code elude me.<p><a href="https://github.com/malisper/pgrust/blob/3646a73515a5e4ac7d0b7df88c61b180e1cabdb2/crates/backend/catalog/pg_inherits/src/lib.rs#L450" rel="nofollow">https://github.com/malisper/pgrust/blob/3646a73515a5e4ac7d0b...</a><p><a href="https://github.com/malisper/pgrust/blob/3646a73515a5e4ac7d0b7df88c61b180e1cabdb2/crates/backend/catalog/pg_inherits/src/lib.rs#L221" rel="nofollow">https://github.com/malisper/pgrust/blob/3646a73515a5e4ac7d0b...</a></p>
]]></description><pubDate>Thu, 09 Jul 2026 08:13:08 +0000</pubDate><link>https://news.ycombinator.com/item?id=48842529</link><dc:creator>queoahfh</dc:creator><comments>https://news.ycombinator.com/item?id=48842529</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48842529</guid></item><item><title><![CDATA[New comment by queoahfh in "Postgres rewritten in Rust, now passing 100% of the Postgres regression tests"]]></title><description><![CDATA[
<p>From what I skimmed manually, not that many, but the code itself seems labyrinthical. Like, why have both Rust Try-supporting Error-like tagged union, but also booleans, for error handling, in the same function?<p><a href="https://github.com/malisper/pgrust/blob/3646a73515a5e4ac7d0b7df88c61b180e1cabdb2/crates/backend/catalog/pg_inherits/src/lib.rs#L450" rel="nofollow">https://github.com/malisper/pgrust/blob/3646a73515a5e4ac7d0b...</a><p><a href="https://github.com/malisper/pgrust/blob/3646a73515a5e4ac7d0b7df88c61b180e1cabdb2/crates/backend/catalog/pg_inherits/src/lib.rs#L221" rel="nofollow">https://github.com/malisper/pgrust/blob/3646a73515a5e4ac7d0b...</a></p>
]]></description><pubDate>Thu, 09 Jul 2026 08:11:23 +0000</pubDate><link>https://news.ycombinator.com/item?id=48842518</link><dc:creator>queoahfh</dc:creator><comments>https://news.ycombinator.com/item?id=48842518</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48842518</guid></item><item><title><![CDATA[New comment by queoahfh in "Postgres rewritten in Rust, now passing 100% of the Postgres regression tests"]]></title><description><![CDATA[
<p>What a peculiar kind of rewrite.<p>Rust:<p><a href="https://github.com/malisper/pgrust/blob/3646a73515a5e4ac7d0b7df88c61b180e1cabdb2/crates/backend/catalog/pg_inherits/src/lib.rs#L450" rel="nofollow">https://github.com/malisper/pgrust/blob/3646a73515a5e4ac7d0b...</a><p>Original:<p><a href="https://github.com/postgres/postgres/blob/df293aed46e3133df3b5b337f095e3ebed69fd79/src/backend/catalog/pg_inherits.c#L355" rel="nofollow">https://github.com/postgres/postgres/blob/df293aed46e3133df3...</a><p>Usage:<p><a href="https://github.com/malisper/pgrust/blob/3646a73515a5e4ac7d0b7df88c61b180e1cabdb2/crates/backend/catalog/pg_inherits/src/lib.rs#L221" rel="nofollow">https://github.com/malisper/pgrust/blob/3646a73515a5e4ac7d0b...</a><p>The return type in the rewrite is both some sort of Error tagged union that supports the Try machinery in Rust; but, it also contains a boolean that apparently must be checked; or something. It seems labyrinthical and possibly broken and terrible.</p>
]]></description><pubDate>Thu, 09 Jul 2026 08:07:35 +0000</pubDate><link>https://news.ycombinator.com/item?id=48842481</link><dc:creator>queoahfh</dc:creator><comments>https://news.ycombinator.com/item?id=48842481</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48842481</guid></item><item><title><![CDATA[New comment by queoahfh in "Postgres rewritten in Rust, now passing 100% of the Postgres regression tests"]]></title><description><![CDATA[
<p>Didn't the initial rewrite of Bun into Rust have an ocean of "unsafe" in it, and wasn't it entirely dysfunctional?</p>
]]></description><pubDate>Thu, 09 Jul 2026 07:42:48 +0000</pubDate><link>https://news.ycombinator.com/item?id=48842266</link><dc:creator>queoahfh</dc:creator><comments>https://news.ycombinator.com/item?id=48842266</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48842266</guid></item></channel></rss>