Why Is SQLite Coded In C
sqlite.org
Why Is SQLite Coded In C
1–10 of 411 posts
Re: Why Is SQLite Coded In C
#2Re: Why Is SQLite Coded In C
#3Re: Why Is SQLite Coded In C
#4Zig gives the programmer more control than Rust. I think this is one of the reasons why TigerBeetle is written in Zig.
Re: Why Is SQLite Coded In C
#5I’d be curious to know what the creators of SQLite would have to say about Zig. Zig gives the programmer more control than Rust. I think this is one of the reasons why TigerBeetle is written in Zig.
From section "1.2 Compatibility". How easy is it to embed a library written in Zig in, say, a small embedded system where you may not be using Zig for the rest of the work?
Also, since you're the submitter, why did you change the title? It's just "Why is SQLite Coded in C", you added the "and not Rust" part.
Re: Why Is SQLite Coded In C
#6 Safe languages insert additional machine branches to do things like verify that array accesses are in-bounds. In correct code, those branches are never taken. That means that the machine code cannot be 100% branch tested, which is an important component of SQLite's quality strategy.
Rust needs to mature a little more, stop changing so fast, and move further toward being old and boring.
Rust needs to demonstrate that it can do the kinds of work that C does in SQLite without a significant speed penalty.Re: Why Is SQLite Coded In C
#7I’d be curious to know what the creators of SQLite would have to say about Zig. Zig gives the programmer more control than Rust. I think this is one of the reasons why TigerBeetle is written in Zig.
> Nearly all systems have the ability to call libraries written in C. This is not true of other implementation languages. From section "1.2 Compatibility". How easy is it to embed a library written in Zig in, say, a small embedded system where you may not be using Zig for the rest of the work? Also, since you're the submitter, why did you change the title? It's just "Why is SQLite Coded in C", you added the "and not…
Re: Why Is SQLite Coded In C
#8Earlier quoted context omitted.
> Nearly all systems have the ability to call libraries written in C. This is not true of other implementation languages. From section "1.2 Compatibility". How easy is it to embed a library written in Zig in, say, a small embedded system where you may not be using Zig for the rest of the work? Also, since you're the submitter, why did you change the title? It's just "Why is SQLite Coded in C", you added the "and not…
The article allocates the last section to explaining why Rust is not a good fit (yet) so I wanted the title to cover that part of the conversation since I believe it is meaningful. It illustrates the tradeoffs in software engineering.
From the site guidelines: https://news.ycombinator.com/newsguidelines.html
Re: Why Is SQLite Coded In C
#9These points strike me: Safe languages insert additional machine branches to do things like verify that array accesses are in-bounds. In correct code, those branches are never taken. That means that the machine code cannot be 100% branch tested, which is an important component of SQLite's quality strategy. Rust needs to mature a little more, stop changing so fast, and move further toward being old and boring. Rust ne…
This is annoying in Rust. To me array accesses aren't the most annoying, it's match{} branches that will never been invoked.
There is unreachable!() for such situations, and you would hope that:
if array_access_out_of_bounds { unreachable!(); }
is recognised by the Rust tooling and just ignored. That's effectively the same as SQLite is doing now by not doing the check. But it isn't ignored by the tooling: unreachable!() is reported as a missed line. Then there is the test code coverage including the standard output by default, and you have to use regex's on path names to remove it.Re: Why Is SQLite Coded In C
#10https://news.ycombinator.com/item?id=28278859 - August 2021
https://news.ycombinator.com/item?id=16585120 - March 2018