Postgres rewritten in Rust, now passing 100% of the Postgres regression tests
28 points by Vaelatern
28 points by Vaelatern
The version that passes 100% of the PG regression tests is still in development and has not been released yet.
As-is, the version in the repo does pass 100% of the PG regression tests. There's a separate version in development that, depending on the workload, is much faster than Postgres.
It's like a case study in "how not to do it".
It's a neat trick, and would have been unimaginable just a year or two ago. But duping the code, while passive aggressively abandoning the ferocious expertise of the pg contributors, is misguided, and will end poorly.
Let's agree to meet back here in six months. Anyone care to lay $50 on it?
What exactly is wrong with it? I just like building cool stuff and this project has been a lot of fun. I have tons of respect for the pg contributors and they've built a really amazing piece of software.
I just like building cool stuff
One other change I made was I was no longer reading most of the code
These 2 statements cannot both be true.
Lobsters has grown slowly, organically and intentionally. An LLM agent couldn't create this community. Sure it could build the software, but it can't cultivate human relationships. Obviously I can't speak for everybody here, but I feel that Lobsters leans towards a deeper sense of building things. What does it mean to truly engage with a problem? Is it possible that software is as much about personal growth as it is about technical achievement? How are we stronger together? How do we stay together? How do we communicate? How do we disentangle personal issues from external ones? If you've never written code purely to avoid talking to a difficult person, then are you even a programmer?
Software is about humans. The fact that you believe the heart of Postgres exists in its code certainly makes me, and I suspect others, sceptical that you're actually engaging with any kind of meaningful problem.
I can't help but think of porn. There is of course nothing inherently wrong with either viewing the intimacy of consenting adults, or, using advanced tools trained on consensually consumed data. Loading up porn is easy. Actually going out, meeting people and being vulnerable is hard. Of course what you do in the privacy of your own life is nobody else's business. But I don't think many people in this community are going to be interested in the whims of your engineering fantasies.
My big belief about software devs is that LLMs have revealed two distinct groups that were largely conflated.
You have a group that loves the result of coding, building things to use/share/deploy/sell/etc, and then you have a group that loves the craft and activity of coding itself. I'm guessing malisper is in the first group.
Previously, software was hard enough that both groups mastered the craft to get what they wanted. (Though there were signs even then: think of the PHP consultant you know who just wanted to sell boilerplate sites to customers.)
But LLMs enable the former group to focus more on the output than the craft, and now they're diverging. I think Lobsters is mostly in the "loves the craft" group, and for 25 years, I would have said the same. Unfortunately, running a small SaaS has forced me to focus on output, not personal preference. I had to give up my attachment to being a coder first, SaaS owner second.
Barring some major changes (LLM economics, laws, etc), I would expect increasingly better models to take over all routine programming in the next few years. Programming will be reserved for cutting-edge work and weekend fun, like taking up Japanese woodworking as a hobby.
You have a group that loves the result of coding, building things to use/share/deploy/sell/etc, and then you have a group that loves the craft and activity of coding itself. I'm guessing malisper is in the first group.
idk. One of the things I've always loved the most about programming is writing programs that write other programs. One of the first programming languages I learned was Lisp and I loved it because it made it so easy to manipulate code. My username is a testament to that.
I see LLMs very much the same way. When programming with LLMs, you are building a machine that builds programs. There's just something very cool about doing that at scale.
This statement really calls into question what the word build means. Are you really "building" a machine, or are you just using one that someone else "built?"
Are you still a carpenter if you don't make your own hammer and nails?
Are you building an executable if your programming language is divorced from assembly and CPU instruction sets?
Can a head chef claim they created a dish if they designed it, even if they're not the one who makes it each night in the kitchen?
Does a project manager get to claim they helped build their project?
This is the same as the two groups, restated in a different form, I think. If building means "caused a new thing to exist", then yes. If building means "rigor and certain tools", then no?
Are you still a carpenter if you don't make your own hammer and nails?
Yes. I'm confident that basically all would agree.
Are you still a carpenter if you tell someone else what to do instead of doing it yourself? Probably not, you're either a manager or a customer depending on your relationship with them.
Are you a carpenter if you press the "table" button on the 3D wood printer and it spits one out? What if the interface changes and you have to type "make me a table with four legs" and choose from a set of blueprints first?
Some of these questions have obvious answers and some are more controversial. If you proudly claim to have built something while putting in little effort you can expect some pushback.
Are you still a carpenter if you don't make your own hammer and nails?
Hammers and nails are deterministic and an extension of the user. Perhaps a better analogy is a carpenter instructing their apprentice to make something, and giving them specific guidance on how to do it.
Maybe "better" because it's obviously the blacksmith who makes the hammer and nails, but no AI analogy that draws comparison with a person will ever be fit for purpose as it discards the contention at hand.
This site needs a sticky thread with a canonical example of an AI analogy exchange so we can all save our energy for something more fulfilling instead
We just need notation like chess (I write this as an example, NOT trying to take one side or the other, heavy /s implied)
From here out we can just post the "move" and save a lot of typing.
env 1
env2!
env 1
env 2
law 1
Then once someone gathers all the arguments into an opening move book, we will be able to settle this once and for all. "Oh, he's going for a tentacloids defense, this will be a draw, let's just talk about ergonomic keyboards instead."
Are you building an executable if your programming language is divorced from assembly and CPU instruction sets?
You didn't write machine code into an executable. 'Build' is a shorthand here, in the same way that 'I'm flying to Berlin next weekend' doesn't imply your'e a pilot, or that you won't hit the ground if you jump out of a plane.
Can a head chef claim they created a dish if they designed it, even if they're not the one who makes it each night in the kitchen?
No, not unless they're the ones who made it first, themselves.
Does a project manager get to claim they helped build their project?
Helped, yes. Built, no.
Are you making the language models yourself..? If not, you're not writing a program to generate programs, you're just using someone else's pre-made tool to generate programs. You're not making anything.
There's a base we have to take as a given, or we'll be in absurd territory. Have you written your own lisp as raw binary? If not you're just using someone else's pre-made tool to generate programs.
Of course I'm using other people's pre-made tools to generate programs when I use a compiler. But I'm also not going around talking about how much I love writing tools to generate code as I do it.
"I always loved writing compilers, that's why I use gcc to compile my software. No, I'm not a gcc contributor, why would you think that?"
But you're just ... using that base. When I wrote my lisp in Rust, I used the Rust compiler as a tool. I wrote Rust code, then I used a tool to convert that Rust code into a binary which can interpret (my own dialect of) Lisp programs. I wouldn't say I made a tool to generate code.
You're ... just taking someone else's program generator and generating programs with it. You're a user, not a maker.
I don't think that threshold is as strict as you think. We've been trying to get the generated code for a very long time, abstracting everything possible. On the syntax side, 4th generation language dream was being close to human language, we had modelling languages, we had attempts like COBOL. On the implementation side, we had things that try to push the condensed meaning, like visual languages, meta programming, etc. I remember some diagram-to-app generator pushed decades ago at uni (I think Sybase?).
Are you a user or a maker if you put a human model into a graphical game engine editor and hook up the limbs to preexisting running sequence to get the result you want? Are you a user or a maker if you add a few model lines to a rails skeleton, generate the scaffolding, then add CSS skin you bought and publish that as an internal app? If we look at the whole history of computing, I'd argue the abstraction/generation jump was as big between punchcards and blueprints in Unreal Engine as between modern coding and LLMs. And you still have as much agency as you want.
I think this analogy would hold if you actually made your own LLM, but you're just using someone else's, no?
I've been in both groups. I loved the craft for the first 15-20 years perhaps, but that period ended already 10 years ago. So it has gotten somewhat boring and now I'd rather just get results -- and I'm getting more concious of how little time I have left on this planet.
Granted, I never felt the need to go superdeep into anything, I was more like a jack of all trades, master of none. So LLMs are a perfect match for me currently, but I can see how they might not be for some.
As for the human element, getting into communities was also easier in late 90s and early 2000s, I feel, possibly because IRC and mailing lists were so much better and common than wherever people have dispersed to now.
Either both can be true, or you're implying that large projects can't be cool. There's a scale where you can't be familiar with everything and at some point you'll ask someone else to implement a part you're interacting with. That's equivalent to not reading all the code anymore.
passive aggressively abandoning the ferocious expertise of the pg contributors
I'm getting pretty tired of the social license to ascribe arbitrary malice towards anyone in the general vicinity of AI.
It's an experimental fork of an open-source project that celebrates forks and is designed to enable them. It's not a hostile action.
what are we betting on here? like, will the git repo still be here? i think so. why not ¯_(ツ)_/¯ will anyone be running it ? idk
Fascinating that AI agents are capable of producing a million lines of workable code in a relatively short period of time. The question is whether this approach is maintainable or sustainable (I'm very skeptical)
One should be aware that for many situations it will not be a drop-in replacement due to its AGPLv3 license https://github.com/malisper/pgrust/blob/v0.1/LICENSE
If it's vibecoded is that even enforceable? At least in the US, LLMs can't hold copyright.
Regardless, it's ironic for an LLM-generated program to use a strict license considering LLM companies' disregard for licenses.
Licences are to some degree about legal and financial risk. It may not be enforceable, but it signals that you may have to sink a lot of money into lawyers defending yourself to find out if that is the case.
It also goes the other way. A friend of mine had his GPL licence violated by a household-name multinational corporation when they used his project as the engine of one of their flagship products. Even with hard technical evidence from third-parties and written admission from the company legal team saying that they had adapted his code, after several years and a bunch of money spent on lawyers he got nothing at all. He couldn't compete with the legal and financial capacity of that corporation.
Why wouldn't it be a drop-in replacement? You could just comply with the AGPL and release the source code, which is no big deal at all. It's only not a drop-in replacement if you're specifically building a proprietary Postgres extension or something, but that wouldn't be compatible anyway since the extension API is different.
You need to release the source code to anyone who can access network services of the codebase, which for a database server should not be anyone outside your organization. Conclusion: This is actually a situation where the AGPL works pretty well! A rarity.
My experience has been that the company usually has very strong opinions about the use of AGPL software, and, thus, it is not a drop-in replacement, just like I said
Interesting:
Of course, a lot of dumb code makes its way through, and that’s okay. Given how early pgrust is, it’s way more about getting something that works than writing the best possible code. It’s faster to get to good state by trusting the agent and fixing things when they go wrong.
While that is perfectly fine to get something working, do you think it is a good approach to have a codebase on which people want to work, maintain and extend? If it were to become something widely used, wouldn't it need to largely rewritten then?
I would never ever deploy such a monstrosity. This is so naive.
Why assume they built it to satisfy you and your values specifically? They probably weren’t thinking about you at all when they made it, and may not care very much whether you would deploy it. 🤷♂️
Why assume they built it to satisfy you and your values specifically? They probably weren’t thinking about you at all when they made it, and may not care very much whether you would deploy it. 🤷♂️
Why assume they built it to satisfy you and your values specifically? They probably weren’t thinking about you at all when they made it, and may not care very much whether you would deploy it. 🤷♂️
A few questions, out of curiosity:
I'm not the author, but the readme answers some of your questions:
The goal is to make Postgres easier to change from the inside: keep the behavior Postgres-shaped, keep the real Postgres tests as the oracle, and use Rust plus AI-assisted programming to explore deeper server changes.
Update: We're working on a new not yet published version of pgrust that currently passes 100% of Postgres regression suite, has a thread per connection model instead of process per connection, is 50% faster than Postgres on transaction workloads, and is ~300x faster than Postgres on analytical workloads (2x slower than Clickhouse on clickbench and we think it can get faster than Clickhouse).
Don’t focus too much on a regression test. What makes or breaks a project like Postgres is the community. The shared knowledge and experiences. The 121 people listed in git and the hundreds more likely thousands of individuals who contributed and made the project what it is now.
This rewrite is a fun experiment but nothing more than that.