Re:Why Is SQLite Coded in C and not Rust
by nubbler on Tuesday October 14, 2025 @10:12PM
(#45587334)
Another commenter in this thread used the phrase "complex abomination" which seems more and more apt the more I learn about Rust.
Re:Why Is SQLite Coded in C and not Rust
by J_Shelby_J on Wednesday October 15, 2025 @11:22AM
(#45593974)
Nothing in this world is perfect, but this behavior is less of an abomination than whatever a junior dev on a timeline might write to handle this condition.
This is a dubious statement. In Rust, the array indexing operator arr[i] is syntactic sugar for calling the function arr.index(i), and the implementation of this function on the standard library's array types is documented to perform a bounds-check assertion and access the element.
So the checks aren't really implicitly added -- you explicitly called a function that performs a bounds check. If you want different behavior, you can call a different, slightly-less-ergonomic indexing function, such as `get` (which returns an Option, making your code responsible for handling the failure case) or `get_unchecked` (which requires an unsafe block and exhibits UB if the index is out of bounds, like C).