‹ BackHN Continuity

Thread

Looking forward to Git 2.56 – and 3.0

207 points · 116 comments · chmaynard

  1. coliveira · · focus · HN ↗
    It is regrettable that they're trying to coerce the use of Rust everywhere just for the sake of it. It's a nonsense that is now forced on everyone.
    1. tombert · · focus · HN ↗
      I don't think it's "just for the sake of it". I think they believe that the Rust code will be safer.
      1. coliveira · · focus · HN ↗
        If that's the case, they should stop using git and Linux right now, because it's everything written in C. Having 0.1% of the code in a safe language will not change anything, it's only a bad security blanket.
        1. nvme0n1p1 · · focus · HN ↗
          You don't believe in slowly and iteratively improving a codebase over time? Should git stick with its weird mishmash of C and perl and shell scripts forever, for tradition's sake, performance and maintainability be damned?
        2. aw1621107 · · focus · HN ↗
          > Having 0.1% of the code in a safe language will not change anything, it's only a bad security blanket.

          Just because something does provide an immediate perfect solution does not mean it isn't not worth investigating and/or pursuing.

          Also consider that bugs tend to be more prevalent in new code (e.g., [0]) as a result, you are likely to see more of a benefit from writing new code in a memory-safe language than raw line count proportions would indicate.

          [0]: <a href="https:&#x2F;&#x2F;security.googleblog.com&#x2F;2024&#x2F;09&#x2F;eliminating-memory-safety-vulnerabilities-Android.html" rel="nofollow">https:&#x2F;&#x2F;security.googleblog.com&#x2F;2024&#x2F;09&#x2F;eliminating-memory-s...

        3. baq · · focus · HN ↗
          Rewriting it all in rust with bug for bug compatibility and byte identical outputs won’t cost more than $100k in tokens, but I don’t think this is an answer you’re looking for
        4. devilsdata · · focus · HN ↗
          I don&#x27;t understand your reasoning. Why should they quit git and Linux (and presumably all applications written in C) if they believe Rust is more secure than C?
          1. Joker_vD · · focus · HN ↗
            It&#x27;s the classic &quot;Yet you participate in society. Curious!&quot; response. You don&#x27;t get dislike the current state of the world if you exists in it, apparently.
        5. shakow · · focus · HN ↗
          I hope you don&#x27;t use seatbelts in your car, as they won&#x27;t help you against a fire.
    2. jcranmer · · focus · HN ↗
      The comments gives a link to a recent talk about the motivation for using Rust in Git: <a href="https:&#x2F;&#x2F;github.com&#x2F;bk2204&#x2F;talk-rust-in-git&#x2F;blob&#x2F;dev&#x2F;presentation.adoc#rust-in-git-status-internals-and-features" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;bk2204&#x2F;talk-rust-in-git&#x2F;blob&#x2F;dev&#x2F;presenta...

      I wouldn&#x27;t agree with all of those reasons, but it&#x27;s very definitely not &quot;just for the sake of it.&quot; One of the better reasons so many people look to writing some things in Rust is that we now have pretty ample evidence than trying to write a binary file format parser in C is a cornucopia of CVEs that are just simply absent in Rust, and the excuse of &quot;well, but a sufficiently smart programmer doesn&#x27;t write bugs in C&quot; doesn&#x27;t cut it anymore.

      1. coliveira · · focus · HN ↗
        Somehow we have binary file format parsers written in C everywhere, so the real world shows it is possible and we do have programmers capable of doing it.
        1. jcranmer · · focus · HN ↗
          Sure, we can write a binary file format parser in C. We just can&#x27;t figure out how to write one that isn&#x27;t buggy and lets someone infect your computer if you give it sufficiently inventive garbage.
        2. eviks · · focus · HN ↗
          The issue isn&#x27;t whether it&#x27;s possible to have parsers, but whether it&#x27;s possible to have them be secure, and periodic CVEs &quot;everywhere&quot; suggest we don&#x27;t
          1. cxr · · focus · HN ↗
            Aside from memory safety, which is solved by using a compiler that just doesn&#x27;t allow unsafe memory operations (so not GCC or Clang upstream), which CVEs specifically would have been ameliorated by a parser written in Rust instead of C?
            1. duskwuff · · focus · HN ↗
              &gt; Aside from memory safety, which is solved by using a compiler that just doesn&#x27;t allow unsafe memory operations

              I don&#x27;t see how that&#x27;s possible without turning the language into something that isn&#x27;t C, either by adding significant new functionality (e.g. fat pointers) or subtracting enough functionality that it&#x27;s a much less capable language (e.g. disallowing dynamic memory allocation).

              1. hellcow · · focus · HN ↗
                Behold: <a href="https:&#x2F;&#x2F;fil-c.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;fil-c.org&#x2F;

                An important improvement over rust is that &quot;Fil-C has no unsafe statement.&quot;

                1. rpadovani · · focus · HN ↗
                  As everything, there are compromises and prices to pay.

                  In case of fil-c, it is about 1.5-4x slower performance, and a memory overhead.

                  So, let&#x27;s not present it as a panacea to all problems: there could good reasons to use it, but it isn&#x27;t a magic trick.

                  1. GoblinSlayer · · focus · HN ↗
                    Rust is slower too, and git is IO bound anyway, and routinely calls bash.
                    1. insanitybit · · focus · HN ↗
                      Rust is not 1.5-4x slower at all. Git is not IO bound at all, it is not saturating your IO device, it just performs IO a lot.
            2. eviks · · focus · HN ↗
              Aside from the fact that it&#x27;s not solved by using an alternative compiler, why would you put the core advantage aside?
              1. cxr · · focus · HN ↗
                What?
        3. 112233 · · focus · HN ↗
          Somehow we also have memory safety bugs everywhere, too. So real world shows bugs in C code are possible. What even is your argument? Real men write asm?
    3. epidemian · · focus · HN ↗
      Of the codebases i know that have adopted Rust, it has always been because some of their maintainers wanted to do so.

      Maybe git&#x27;s case is different though. Do you have more info about it? Are you a git maintainer who was coerced to use Rust, or do you know of such cases?

    4. serbuvlad · · focus · HN ↗
      fwiw, the use of C is infinitely more &quot;coerced&quot; than the use of Rust.

      on my Linux system, C takes ownership of a &#x27;top-level&#x27; &#x2F;usr&#x2F;include directory, all the kernel APIs have their canonical definitions in C headers, a lot of system features like nsswitch require dynamically linked C libraries etc. etc.

      Rust is just something that programs can choose to be written in and that doesn&#x27;t inconvenience me in any way.

      1. tosti · · focus · HN ↗
        It doesn&#x27;t need to be that way: <a href="https:&#x2F;&#x2F;gobolinux.org&#x2F;at_a_glance.html" rel="nofollow">https:&#x2F;&#x2F;gobolinux.org&#x2F;at_a_glance.html
    5. devilsdata · · focus · HN ↗
      Is all use of Rust &quot;coerced&quot; and &quot;forced on everyone&quot;, or is there a way to write things in it that makes sense?
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.