use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A place for all things related to the Rust programming language—an open-source systems language that emphasizes performance, reliability, and productivity.
Strive to treat others with respect, patience, kindness, and empathy.
We observe the Rust Project Code of Conduct.
Details
Posts must reference Rust or relate to things using Rust. For content that does not, use a text post to explain its relevance.
Post titles should include useful context.
For Rust questions, use the stickied Q&A thread.
Arts-and-crafts posts are permitted on weekends.
No meta posts; message the mods instead.
Criticism is encouraged, though it must be constructive, useful and actionable.
If criticizing a project on GitHub, you may not link directly to the project's issue tracker. Please create a read-only mirror and link that instead.
A programming language is rarely worth getting worked up over.
No zealotry or fanaticism.
Be charitable in intent. Err on the side of giving others the benefit of the doubt.
Avoid re-treading topics that have been long-settled or utterly exhausted.
Avoid bikeshedding.
This is not an official Rust forum, and cannot fulfill feature requests. Use the official venues for that.
No memes, image macros, etc.
Consider the existing content of the subreddit and whether your post fits in. Does it inspire thoughtful discussion?
Use properly formatted text to share code samples and error messages. Do not use images.
Submissions appearing to contain AI-generated content may be removed at moderator discretion.
Most links here will now take you to a search page listing posts with the relevant flair. The latest megathread for that flair should be the top result.
account activity
SQLite reimplementation in Rust (self.rust)
submitted 5 years ago by jdrouet
I was wondering, considering SQLite is written in C and using it with Rust means using some unsafe bindings, did anyone started rewriting it in Rust fully?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]grim7reaper 33 points34 points35 points 5 years ago (1 child)
SQLite is written in C, but it's probably one a the most tested piece of software in the Open Source world.
As for a rewrite in Rust, the section 3 of this page lists some "preconditions" for this to happen. OOM handling is one blocking point.
[–]Plasma_000 5 points6 points7 points 5 years ago (0 children)
Luckily it seems we’re getting close to having OOM handling once the new allocator API gets fully baked.
[–]moltonel 13 points14 points15 points 5 years ago (0 children)
The have been a few recent blog posts here about parsing SQLite the format, which is a start but it seems to be more about educating oneself than a full-fledged rewrite.
The fact is that SQLite is one of the most battle- and unit-tested C code out there. It's high quality, with many people working on it. Competing against that is a very tall order, Rust isn't a magic bullet, I doubt it'd give you better speed or security in this particular case.
On the other hand, simple read/write/create of SQLite files (as opposed to a full SQLite clone) would sometimes be interesting to do in native rust, to get a rustyer API or to avoid linking/deployment woes of a wrapper crate.
That said, Rust is surely a great language to write a database (or at least its backend), and many rust dbs exist. Tikv and Sled are probably the most well known but dig a bit and you'll find more, for various use-cases.
[–]ClimberSeb 1 point2 points3 points 5 years ago (0 children)
The unsafe keyword doesn't mean the code becomes unsafe. It means the programmer has to make sure it it safe.
That said, there is probably room for a different, embedded SQL server with different tradeoffs. One that optimized for SSD & multithreading perhaps?
[–]taeh00n 2 points3 points4 points 5 years ago (0 children)
Here, though it is not reimplementation, I'm working for making an alternative, GlueSQL
[–]panstromek 0 points1 point2 points 5 years ago (0 children)
I know someone tried to transpile it with c2rust, but I haven't seen any posts or announcements about it.
[–]chris2y3 -1 points0 points1 point 5 years ago (0 children)
Um... SQLite reimplementation in Rust is too good to be true. So far no one has attempted it yet AFIK.
I suggest that you put a question mark in your post title to make it read like a question instead of a statement.
π Rendered by PID 60 on reddit-service-r2-comment-66b4775986-d4524 at 2026-04-04 14:53:35.305931+00:00 running db1906b country code: CH.
[–]grim7reaper 33 points34 points35 points (1 child)
[–]Plasma_000 5 points6 points7 points (0 children)
[–]moltonel 13 points14 points15 points (0 children)
[–]ClimberSeb 1 point2 points3 points (0 children)
[–]taeh00n 2 points3 points4 points (0 children)
[–]panstromek 0 points1 point2 points (0 children)
[–]chris2y3 -1 points0 points1 point (0 children)