An unofficial, read-only Hacker News reader.

Ladybird is now in alpha (opens external site)

2478 points by janvdberg 6 days ago | ladybird.org | 749 comments on HN

View full thread · View on Hacker News

Comment thread (40)

  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.
            Replies (1)
            1. eh but I think at this point we can all assume when somebody says they want to reimplement something in rust they mean vague security things, asking why is really asking for anything more specific than that
          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

            Replies (1)
            1. Possibly controversial opinion: as the frontier of LLMs improves, things like memory safety can be a solved problem in any language capable of it.

              The solution to sqlite memory safety isn't porting it to Rust. It's for someone to spend a hundred dollars a year auditing the C code for vulnerabilities with each new frontier model as they're made available.

              Continue this thread (3 replies) →

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

            And just look what's been happening.

            Replies (1)
            1. I feel like most of the Linux vulnerabilities lately haven't been kernel level vulnerabilities but rather vulns at distro level or application level like openssh

              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
            Replies (1)
            1. I would highly recommend reading up on what the SQLite test suite actually covers. There is also this recent lecture by Richard Hipp (creator) that might give you a better idea: https://www.youtube.com/watch?v=V_qzqY1bb7I
      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