Why Is SQLite Coded in C and not Rust

https://news.ycombinator.com/rss Hits: 11
Summary

Why Is SQLite Coded In C Table Of Contents 1. C Is Best Note: Sections 2.0 and 3.0 of this article were added in response to comments on Hacker News and Reddit. Since its inception on 2000-05-29, SQLite has been implemented in generic C. C was and continues to be the best language for implementing a software library like SQLite. There are no plans to recode SQLite in any other programming language at this time. The reasons why C is the best language to implement SQLite include: Performance Compatibility Low-dependency Stability 1.1. Performance An intensively used low-level library like SQLite needs to be fast. (And SQLite is fast, see Internal Versus External BLOBs and 35% Faster Than The Filesystem for examples.) C is a great language for writing fast code. C is sometimes described as "portable assembly language". It enables developers to code as close to the underlying hardware as possible while still remaining portable across platforms. Other programming languages sometimes claim to be "as fast as C". But no other language claims to be faster than C for general-purpose programming, because none are. 1.2. Compatibility Nearly all systems have the ability to call libraries written in C. This is not true of other implementation languages. So, for example, Android applications written in Java are able to invoke SQLite (through an adaptor). Maybe it would have been more convenient for Android if SQLite had been coded in Java as that would make the interface simpler. However, on iPhone applications are coded in Objective-C or Swift, neither of which have the ability to call libraries written in Java. Thus, SQLite would be unusable on iPhones had it been written in Java. 1.3. Low-Dependency Libraries written in C do not have a huge run-time dependency. In its minimum configuration, SQLite requires only the following routines from the standard C library: memcmp() memcpy() memmove() memset() strcmp() strlen() strncmp() In a more complete build, SQLite also uses library r...

First seen: 2025-10-14 23:40

Last seen: 2025-10-15 12:42