‹ 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. 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?
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.