Live data from Hacker News

Postgres rewritten in Rust, now passing 100% of the Postgres regression tests

github.com

71–80 of 756 posts

Re: Postgres rewritten in Rust, now passing 100% of the Postgres regression tests

#71
post #48

Earlier quoted context omitted.

I'd %100 prefer an opus 4.8 rewrite over %99 of the time. Unless Fabrice Bellard is rewriting the stuff I need, I'd prefer AI over a human coder.

AI is an average coder. It was trained on all code the code that could be found. Not just code written by genius programmers like Carmack and Bellard. Given that it's average, I'd prefer a human coder above average :)

LLMs learn a distribution during pre-training, not only an average.

Then, by giving them context or by post-training, you can make them sample non-average parts of the distribution they learned.

Re: Postgres rewritten in Rust, now passing 100% of the Postgres regression tests

#73
post #48

Earlier quoted context omitted.

AI is an average coder. It was trained on all code the code that could be found. Not just code written by genius programmers like Carmack and Bellard. Given that it's average, I'd prefer a human coder above average :)

You haven't been using AI extensively I presume... I've been programming a long time and considered myself among the top in my domain and AI agents using like GPT 5.5 etc. are much better than me.

[flagged]

Re: Postgres rewritten in Rust, now passing 100% of the Postgres regression tests

#74

I feel like we need to heavily differentiate between a rewrite and an AI rewrite.

rewrites feel like an area where LLMs are better suited than humans imo

It’s mostly grunt work and LLMs are well suited for translation tasks (iirc transformers arch was originally invented for translation)

Re: Postgres rewritten in Rust, now passing 100% of the Postgres regression tests

#75

What a peculiar kind of rewrite. Rust: https://github.com/malisper/pgrust/blob/3646a73515a5e4ac7d0b... Original: https://github.com/postgres/postgres/blob/df293aed46e3133df3... Usage: https://github.com/malisper/pgrust/blob/3646a73515a5e4ac7d0b... 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 chec…

It is a feature in Rust, not a bug :-) (I know you didn't say it is a bug.)

The error-tagged union is PgResult - which means it contains bool as the result if things go well. (The other part in the union is of course the error.)

In the original function also, it is returning a boolean: "bool has_subclass".

So anyway you have to check for the boolean as part of the logic. That is what it is doing.

Re: Postgres rewritten in Rust, now passing 100% of the Postgres regression tests

#76
post #14

I start to see a lot of these re-writes that depend on tests to state that its working. But the things that make software like Postgres and SQLite reliable are not mostly the test, but the real world production scars. That's where the reliability comes from, years and years of running in production.

> not mostly the test, but the real world production scars Most extensive test suites are exactly production scars: every time you have a bug or a regression, you write a test that confirms correct behaviour. SQLite is a good example to bring up because its extensive closed-source tests are what’s often cited as being what keeps people from forking it. (Turso did it, though, but it takes a company to deliver some gua…

[deleted]

Re: Postgres rewritten in Rust, now passing 100% of the Postgres regression tests

#77
post #44

I am not trolling, but I have a simple question: Why? Why do I use this instead of the official build? What is the business case?

I think a business case for a "look I let an LLM rewrite a large codebase" does not exist.

You are now at 0.1%... now submit upstream in sensible chunks (function or maybe file/module), waiting for people to review (a few per week, maybe) and approve/merge.

Re: Postgres rewritten in Rust, now passing 100% of the Postgres regression tests

#78
How would one go about reviewing a piece of code like this?

One of the things I'd typically do is peek at the commit history. Seeing what people worked on and how they did it tends to say a lot about a project. But with LLMs generating 7101 commits in less than a month that isn't feasible. Even looking at a single day is way too much [1]. It probably also doesn't make sense since the commits content won't tell you much anyway.

ps. How do you easily get to the first commit in a repo on GitHub? Browsing commit history feels rather tedious

[1] - https://github.com/malisper/pgrust/commits/main/?since=2026-...

Re: Postgres rewritten in Rust, now passing 100% of the Postgres regression tests

#79
post #33

Why should a developer use this for anything beyond a pet project? Just because it is written in Rust? All these "rewritten in rust" projects only reinforce the idea that a significant part of the rust community consists of software talibans and not of engineers who must deliver something that works and is reliable over time.

Often the biggest blocker on moving to a new programming language, is the cost of re-writing everything.

Cue some story here on a bank or airline somewhere still relying on cobol backend servers.

These LLM conversions really seem to make modernization of large parts software layers possible!

Re: Postgres rewritten in Rust, now passing 100% of the Postgres regression tests

#80
post #34
post #14

Earlier quoted context omitted.

> not mostly the test, but the real world production scars Most extensive test suites are exactly production scars: every time you have a bug or a regression, you write a test that confirms correct behaviour. SQLite is a good example to bring up because its extensive closed-source tests are what’s often cited as being what keeps people from forking it. (Turso did it, though, but it takes a company to deliver some gua…

Sure, but behaviors that never have a bug or regression don't get a test. Software of this kind of complexity has all kinds of behavior that has never been broken, and doesn't have a specific test written for it. Getting an extensive test suite passing is certainly orders of magnitude better than having no test suite at all, but it still doesn't tell you as much as you need to know. I would absolutely never trust an…

Or even a human rewrite merely because some language is the current fad. A rewrite in a different language should be done for very good reasons, to solve problems that are bigger than the costs of all the bugs that will be introduced.
Post reply on HN