Live data from Hacker News

C Is Best (2025)

sqlite.org

341–350 of 574 posts

Re: C Is Best (2025)

#341
post #338

Earlier quoted context omitted.

For your last sentence, I believe topics are conflated here. Of course if one writes unsafe Rust and it leads to a CVE then that's on them. Who's denying that? On the other hand, having to interact with the part of the landscape that's written in C mandates the use of the `unsafe` keyword and not everyone is ideally equipped to be careful. I view the existence of `unsafe` as pragmatism; Rust never would have taken of…

>>Of course if one writes unsafe Rust and it leads to a CVE then that's on them. >>Who's denying that? >>The recent bug in the Linux kernel Rust code, based on my understanding, was >>in unsafe code, and related to interop with C. So I wouldn't really classify >>it as a Rust bug. Sometimes it's good to read the whole thread.

I did and it does not quite compute. That was glue code, related to interoperating with C. Not a "normal" everyday Rust code. It's an outlier.

Helps to read and ingest context.

Though I do agree that in the strictest of technical senses it's indeed a "Rust" bug, as in: bug in code written in Rust.

Re: C Is Best (2025)

#342

Earlier quoted context omitted.

>To summarize, Rust provides a lot of compile-time discipline that C and C++ are lacking, and many people are tired of maintaining code that was developed without that discipline. Rust makes it harder to write low-effort software. This doesn't explain why so many rust activists are going to projects they have no involvement in and demanding they be rewritten in rust. What's happening is that there are progressive min…

Is it really activism though, i.e. a concerted effort to put pressure on project leaders and make actual "demands"? Or is it just the occasional young Rust enthusiast asking questions or making the case for Rust?

Probably something in-between: a self-organizing cult with too much support from industry.

Re: C Is Best (2025)

#343

This makes sense with the quality and quantity of testing they do. https://sqlite.org/testing.html >As of version 3.42.0 (2023-05-16), the SQLite library consists of approximately 155.8 KSLOC of C code. (KSLOC means thousands of "Source Lines Of Code" or, in other words, lines of code excluding blank lines and comments.) By comparison, the project has 590 times as much test code and test scripts - 92053.1 KSLOC.

That's an enormous test suite but considering how large the SQL spec is it makes sense.

Re: C Is Best (2025)

#344

Earlier quoted context omitted.

I think it's more than just the normal amount for advocacy of a new language. Rust isn't the only "newer" language. I don't feel this kind of mentally strung pushing of say Kotlin or Scala or Go or, etc from their fans.

I think this is because of the gap in its target market -- Rust is firmly positioned to replace C and C++, which have a long history of safety issues. Kotlin is positioned to replace java, and besides a few quality-of-life improvements, it changes some syntax but very few semantics, so the gap is much smaller. Go was originally pitched as a C or C++ replacement, and it's very nice for deeply parallel programs like we…

Carbon is what could someday be a real successor to C++ in my eyes. It actually focuses on being compatible with C++ code similar to how Kotlin can work with Java directly, except it will make a lot more sense once it is stable and usable, I just hope its not a 'forever-project' like Fuchsia.

Re: C Is Best (2025)

#346

Earlier quoted context omitted.

Rust is pushed on the internet

I definitely wouldn't say internet, I think it's popular on HN and a few other online forums. There are a lot of X/twitter circles which make are critical of rust, as well as other sites. In my mind at least there's a decent risk Rust is going to end up like the next Haskell, its benefits other than safety are not that clear and many of those features can and have been replicated in other languages.

Many of its biggest benefits of rust come directly from other languages - including Haskell. Like, rust’s Option is identical to Haskell’s Maybe type. Traits are similar to type classes in Haskell, or interfaces in Go.

In my mind, the thing that makes rust and zig nice are that they put modern language features in a systems language. Non-nullable pointers and match expressions in a language that runs as fast as C? Yes please.

I love rust, but I personally doubt rust will ever be anywhere near as popular as Python, go, JavaScript and C#. It’s just so complex and difficult to learn. But its niche is pretty clear to me: I see it as a tool for writing beautiful, correct, memory safe, performant systems code. I used to love C. But between zig, rust and Odin, I can’t see myself ever using it again. C is just so much less productive and less pleasant to use than more modern languages.

Re: C Is Best (2025)

#348

Earlier quoted context omitted.

I think this is because of the gap in its target market -- Rust is firmly positioned to replace C and C++, which have a long history of safety issues. Kotlin is positioned to replace java, and besides a few quality-of-life improvements, it changes some syntax but very few semantics, so the gap is much smaller. Go was originally pitched as a C or C++ replacement, and it's very nice for deeply parallel programs like we…

Kotlin won't replace Java. They do not have the same niche.

Kotlin's Niche was to replace LEGACY Java with something that builds for older versions of Java but also gives you features and ergonomics not available for those features. There's a ton of super legacy Java out there.

Re: C Is Best (2025)

#349

Tittle should be "C is a Standard"

Title should actually be “Why Is SQLite Coded In C”, since that’s the title of the article.

Well, take "C Is Best"

For someone who might not think so they may think "Why?" and click it.

I think this makes a bit more sense.

Re: C Is Best (2025)

#350
post #309

> But no other language claims to be faster than C for general-purpose programming, because none are. The "faster than C for general-purpose programming" is a pretty woolly claim so I'm not entirely surprised nobody claims that, but equally I think to be sure that "because none are" would need some serious caveats to make it true. In particular you're going to have to say you think it doesn't matter how much develope…

Of course it's true in the case of sqlite. It's one of the most used pieces of software ever, and user cpu time spent is going to dwarf any developer time. Your example should instead be: - 5 hours of developer time to run in 4 seconds * n - 5 minutes of developer time to run in 5 seconds * n As long as n In the case of sqlite, the user time may as well be infinite for determining that side of the equation. It's just…

Also battery life. 20% less time, 20% more battery.

But OP is correct, companies don't care as long as it doesn't translate into higher sales (or lower sales because the competitor does better). That's why you see that sort of optimization mainly in FOSS projects, which are not PDD (profits-driven development).

Post reply on HN