An unofficial, read-only Hacker News reader.

Ladybird is now in alpha (opens external site)

2472 points by janvdberg 5 days ago | ladybird.org | 747 comments on HN

View full thread · View on Hacker News

Comment thread (49)

  1. If you find yourself thinking any time is the right time to reimplement sqlite just because, you're extremely likely to be on the wrong course.
    Replies (3)
    1. I'm not a Rust developer by any stretch of the imagination, but considering how extensive the SQLite test suite is, maybe a long term Rust port would be doable?

      The biggest challenge by far is portability, SQLite, like NetBSD, runs on toasters.

      Replies (5)
      1. A substantial portion of the SQLite test suite is proprietary, so unless Hipp blesses your port and gives you access to that, you'll be at a significant disadvantage.
        Replies (2)
        1. Ah, I didn't know that.
        2. "Substantial" isn't quite right - the vast majority of the SQLite test suite is public.
          Replies (3)
          1. Hmm, the wording on https://sqlite.org/testing.html#test_harnesses made it seem like the proprietary test suite was bigger; however, I've never glanced at the public (TCL) tests, and making it sound like their private tests are better no doubt helps ensure they get more contracts.
          2. TH3 is closed source, and is about 50% of the test suite.
          3. Simon I believe you’re mistake here. The public test suite is quite extensive, to the tune of hundreds of thousands of LoC. Word is that the private test suite is orders or magnitude larger than the public one.

            For the record I have no problems with their business model, they have managed to fund development of a truly unique piece of OSS infrastructure and for this, I’m always thankful to them

            Replies (1)
            1. We don't need to go by rumors, https://sqlite.org/testing.html#test_harnesses spells it out exactly:

              The TCL tests are open source (public domain) - 1390 files, 23.2MB, 51,445 test cases.

              The TH3 test harness is proprietary, written in C, 100% branch coverage. 76.9 MB or 1055.4 KSLOC of C code implementing 50,362 distinct test cases.

              The SQL Logic Test is public, 7.2 million queries comprising 1.12GB of test data.

              Dbsqlfuzz is proprietary, 336 seed files.

              So yeah, "vast majority" isn't justified.

      2. I believe turso did build a sqlite clone in rust that they call libSQL. I think the test suite is proprietary, though, so I'm not sure if they were able to use that.
        Replies (1)
        1. Most of the SQLite test suite is public. There's a small additional private test suite that's mainly useful for people porting it to novel hardware.
          Replies (1)
          1. Ah, thanks for the clarification.
      3. Honest question, why? Is SQLite not performant or lacking in some fashion?
        Replies (2)
        1. Security, presumably. It’s written in C.
          Replies (2)
          1. by people who have put incredible amounts of effort into its safety and correctness, so I don't really think it matters if its written in C.
            Replies (3)
            1. Not really my point I was making, I was just explaining why GP jumped to wanting to rewrite in Rust.

              Continue this thread (1 replies) →

            2. There is some merit for the memory safety angle here, so I can see why someone would be interested in doing that.

              A look at the CVE list reveals that there were some CVEs with read freed memory or array overflows. That said the amount of CVEs is comparatively tiny to other software, so as you said, it really shows that they put incredible amounts of efforts into safety and correctness. Still, there would probably still be some value to it, even if very minimal (is it worth it though?)

              https://sqlite.org/cves.html

              Continue this thread (1 replies) →

            3. The same is said about the Linux kernel and other projects.

              And just look what's been happening.

              Continue this thread (1 replies) →

          2. Red herring? Airbus uses SQLite inside the flight software for the A350 XWB family of aircraft. It has certified Aviation-Grade Testing (DO-178B/C). The proprietary TH3 test harness, which features roughly 600 times more test code than actual source code and achieves 100% Modified Condition/Decision Coverage (MC/DC) at the assembly level. It must some of the most scrutinised source code on the planet.
        2. Because Rust is a cult first and a programming language second. Everything not written in Rust is “impure”
          Replies (1)
          1. This is true, but it is a programming language and I don't know a better way to get memory safety, do you?
      4. The “juicy” test suite is private. I think they may have had some foresight here, because my view is that this model will only get more popular going forward given how cheap it is clone/steal projects.
        Replies (3)
        1. If bun can be ported by LLM with tokens to burn budget. I don’t see why reimplementing in whatever language and the test suite is not possible. Writing tests good and stupid is definitely a job LLM can smash out
          Replies (1)
          1. As far as I know, Bun had a rigorous E2E test suite (i.e. language agnostic) that the LLM could evaluate its progress against.

            My impression is that compilers are probably among the easiest software to port because they rely heavily on E2E tests, have large test suites, and have inputs that are relatively well specified.

            Replies (1)
            1. A person could get LLM to generate a lot of sql tests thou. Sql is been around for a while

              Continue this thread (1 replies) →

        2. More and more the team behind the software is a source of value. Anyone who can write a few paragraphs can produce software that looks good from the outside, but do you trust the team behind it?

          Keeping an extensive suite of tests private is just an artificial way to boost the trust in the team. It's an interesting way for open-source developers to have their cake and eat it too.

          Replies (1)
          1. You see artificial; I see tangible :)

            I think it is either going to be this or open core for OSS going forward.

            Replies (1)
            1. also there's a sense of... some of the feeling of double-blind science or something difficult to express along those lines when you have a separate test suite which is private to verify the first to avoid some kind of "overfitting" which is even more helpful in the LLM days
        3. If you enough token budget, you can an LLM to replicate the unit tests.
      5. Turso Database has already written a rust version of SQLite that is used in production environments. https://github.com/tursodatabase/turso
    2. This is an unhealthy attitude towards learning.
      Replies (3)
      1. It has nothing to do with learning. If you want to learn by rewriting SQLite, go for it. I might not want to use your library, but go ahead - it could be fun.

        Same here - the Ladybird project isn’t about learning. Its goal is to render webpages. So, if you can leverage preexisting libraries for local database or image rendering, you do it.

      2. Normal human conversation routinely depends on leaving the obvious thing unsaid. I think we can afford people the courtesy of assuming the obvious exceptions to any broad statement.
        Replies (1)
        1. Deeming something too obvious to say is wildly subjective, definitely much too subjective to consider any such act an assault on "normal human conversation". For example, I think the reply was appropriate, whereas you don't. Also, making points in a roundabout way - as you did with that comment and as I'm mimicking in mine - isn't clever. It's cognitive bloat. Saying "I think that's obvious" communicates the same information, but without the stench of snobbery or delusion of conveying some broader insight. Surely this terse alternative is more aligned with "normal human conversation", wouldn't you say?
          Replies (2)
          1. The fuzzy social connotations framing them as normal and you as non-normative aren't cognitive bloat. They are part of what the author intended to convey, and normal human conversation includes lots of similar social signals. It does not generally proceed through the exchange of short, declarative statements.
          2. >This is an unhealthy attitude towards learning.

            This comment is responding to a situation that was out of context in a thread that wasn't at all about learning.

            "too obvious to say" ... to the contrary I didn't imagine somebody's invented situation that didn't have anything to do with what was being discussed

      3. sqlite is probably one of the best engineerd pieces of software on the planet and the most used database. if you want to learn more about how the sqlite team thinks about reliability i strongly recommend watching the following talk Richard Hipp gave recently https://www.youtube.com/watch?v=V_qzqY1bb7I

        so i tend to agree, you rewrite sqlite you will end up with an inferior product

    3. You can totally reimplement sqlite. Sqlite is essentially a pile of reasonably implementable pieces. You can start with the journaled paged atomic file, and move on to a B+tree. Don't try to be compatible with the actual sqlite, make your own format with a similar purpose. You don't have to implement SQL to make it useful.