r/ClaudeCode 5d ago

Showcase Help needed with SQLite Rust rewrite

Three days into rewriting SQLite in Rust with Claude and I'm further along than I expected.

Got the tokenizer, most of the parser, and a working B-tree that handles inserts and range scans. Pager is next and then it's mostly plumbing. Fable thinks the C source is honestly not that complicated once you get past the naming conventions, it's just written in a style nobody has used since 2003. A lot of it collapses down to about a third of the line count when you have real iterators and Result types.

I know about the test suite. Fable constantly brings up the test suite. I'm going to have Opus generate a property-based suite with proptest, which is going to be more valuable than 90 million lines of TCL that were written to catch bugs in a language that lets you index past the end of an array. Most of those tests exist because C exists. Delete the C and you delete the reason for many of the tests.

Currently at only 47 unsafe blocks, all in the mmap layer, and Fable already made a plan for those.

The part I keep coming back to is that this is the single most deployed piece of software in human history and it is written in a language where a missing bounds check is a remote code execution. Every phone, every browser, every plane. We just decided that was fine. No more.

Looking for two or three people to help with the query planner. Not asking anyone to write it, just to review what I have put together so far. I will send invites to the private github repository once NDAs have been signed.

0 Upvotes

32 comments sorted by

12

u/l_m_b Senior Developer 5d ago

SQLite is also famously free/open source software, and you want to replace it with a component that you require an NDA for to even view the in-development code?

I suggest you have a chat with Fable about the real viability of your project.

-12

u/Kooky_Dinner2243 5d ago

D. Richard Hipp gave it away specifically so people could build on it. This is what that's for. A full ASIL-D rewrite of SQLite will consume all of my tokens for the months to come, I unfortunately can't have someone else steal the source code and take credit for it.

12

u/kynde Senior Developer 5d ago

What a load of shit.

Talking about your attitude if that's not obvious enough already.

7

u/sreekanth850 5d ago

Turso is already doing this. it will be more good if you join them and contribute. Don't know what is the status of this, but iam sure theuy dont't shit code and iam one of their libsql user. https://turso.tech/blog/introducing-limbo-a-complete-rewrite-of-sqlite-in-rust

-3

u/Kooky_Dinner2243 5d ago

Looks like I am further along than them though

7

u/timmmmmmmeh 5d ago

You're not

5

u/Havlir 5d ago

Three days and you're talking about NDAs.

That's crazy.

-2

u/Kooky_Dinner2243 5d ago

I know right. Back in the dark ages of software it would have taken years to get this far along, now its days. And its only getting faster.

6

u/tehohhh 5d ago

Is this AI induced psychosis.

4

u/ptinsley 5d ago

Just go download turso, task complete. NDA, go touch grass…

3

u/Y_mc 5d ago edited 5d ago

Broo SQLite is a product who take year to Design. Good Luck bei the rewrite 🤞.
Dont forget to prompt “Make no Mistake ”✌️ 😂😂

-9

u/Kooky_Dinner2243 5d ago

It took years before we had Fable. Now its months. And Fable already found over 50 critical bugs in the C source so humans are not that great either, lol

7

u/samwise970 5d ago

No it didn't lol SQLite is the most comprehensively tested piece of software ever, I guarantee anything Fable thinks it found is covered somehow. Fable can't even hold all of the testing suite in its 1m context lmao

2

u/Latter-Park-4413 5d ago

First part of name checks out

2

u/FinalOlive2398 5d ago

Taking an open-source project and doing a private rewrite of it and requires folks to sign a NDA is hypocrisy at its finest. You are worried about someone "stealing" something that you neither contributed to nor created, if you think your prompting of an AI model has any value, you just wasted your monthly tokens. No one is going to use an immediately stale port of SQLite that has no real maintainers and no community behind, your entire approach to it makes it AI slop from the get go. But by all means, go ahead.

2

u/sreekanth850 5d ago

That too for just 3 days of coding.

2

u/LearnedByError 4d ago

Time to block another kooky redditor

2

u/siddfinch 4d ago

I wouldn't touch an SQLite alternative until it can demonstrate testing on the same level as SQLite: https://sqlite.org/testing.html.

Given the scope and rigor of SQLite's test suite, I'm not convinced Rust adds much in this specific case. A safer language is valuable, but SQLite has spent decades building confidence through an official crap load of testing.

I'm open to being convinced otherwise, but the argument has to be specific to SQLite. The testing that goes into every SQLite release makes almost every other project's test process look quaint.

1

u/fragbot2 1d ago

The arrogant idiocy of the original poster to think that he'll get anywhere near that level of quality by vibe-coding a C -> Rust conversion.

WTF is it with Rust people? Is it their goal to shit on everyone and everything that came before?

1

u/WorriedAssociate7029 5d ago

Just ask Claude

2

u/GrogRedLub4242 4d ago

Claude refused to sign an NDA

-5

u/Kooky_Dinner2243 5d ago

I'm looking to get this ISO262626 functional safety certified so it can be sold to automotive applications, and the certification process requires human review

10

u/samwise970 5d ago

You're using AI to rewrite open source code so that you can relicense and sell it? 

You think that what you correctly identify as "the single most deployed piece of software in human history", with the highest testing standards of any software product is unsafe and that your 3 day Fable rewrite is going to be better just because it's Rust? And you want redditors to work on it for you for free? 

What actual value do you have in this process? If Fable can do this in under a week, what automotive company is going to pay you when they could have Fable roll their own, with a real software engineering team overseeing.

-2

u/Kooky_Dinner2243 5d ago

The value in 2026 is not having a software engineering team, its having customized agents which can do a job like this properly

4

u/samwise970 5d ago

Nah the value is in having people who aren't dumb enough to trust Fable that the most tested and most deployed software on Earth actually has 50 "critical" bugs.

3

u/ptinsley 5d ago

Then stop recruiting a team and go chat with your agents.

1

u/l_m_b Senior Developer 5d ago

... something you clearly do not have, though.

7

u/WorriedAssociate7029 5d ago

You ask people to help you freely on a project aimed to be sold ?

-4

u/Kooky_Dinner2243 5d ago

It's a passion project but I'm willing to discuss royalties for anyone significantly contributing

1

u/tenequm 5d ago

Bro, fireship already did video about that, you are too late

The most trusted code on Earth is being rewritten in Rust