Live data from Hacker News

Git: Introduce Rust and announce it will become mandatory in the build system

lore.kernel.org

141–150 of 433 posts

Re: Git: Introduce Rust and announce it will become mandatory in the build system

#141
post #98

I am curious, what is the reason behind introducing Rust in Git? I am not familiar with Git development, I am just a user. But my impression is that it is already a complete tool that won't require much new code to be written. Fixes and improvements here and there, sure, but that does not seem like a good reason to start using a new language. In contrast, I understand why adding it to e.g. Linux development makes sen…

Git is constantly gaining features, even if for the most part it seems like the core functionality is unchanged.

If you'd like to review the changelog, the Git repo has RelNotes but I've found GitHub's blog's Git category to be a more digestible resource on the matter: https://github.blog/open-source/git/

Re: Git: Introduce Rust and announce it will become mandatory in the build system

#142
post #131

Earlier quoted context omitted.

I honestly can't tell if this is meant as serious reply to my question (in that case: let's say I agree that Rust is 100% better than C; my question still stands) or as a way to mock Rust people's eagerness to rewrite everything in Rust (in that case: are you sure this is the reason behind this? They are not rewriting Git from scratch...)

As a user, you may not be aware that C makes it relatively easy to create https://en.m.wikipedia.org/wiki/Buffer_overflow which are a major source of security vulnerabilities. This is one of the best reasons to rewrite software in Rust or any other more safe by default language.

This doesn't matter at all for programs like Git. Any non-free standing program running on a modern OS on modern hardware trying to access memory its not supposed to will be killed by the OS. This seams to be the more reasonable security-boundary then relying on the language implementation to just not issue code, that does illegal things.

Yeah sure, memory-safety is nice for debuggibility and being more confident in the programs correctness, but it is not more than that. It is neither security nor proven correctness.

Re: Git: Introduce Rust and announce it will become mandatory in the build system

#143
post #86

Given that rust only works on e.g. cygwin recently (and still does not build many crates: i try to compile jujutsu and failed), this is a big blow to portability IMHO. While I try to like rust, I think making it mandatory for builds of essential tools like git is really too early.

Git works only on cygwin too?

No, it doesn't. OP meant that the Rust support on Cygwin is bad; it is better with the native Windows API.

Re: Git: Introduce Rust and announce it will become mandatory in the build system

#144

Earlier quoted context omitted.

Changing well-tested code is unsafe.

If the code is brittle to change, it must not have been particularly safe in the first place, right? And if it's well-tested, maybe that condition is achieved by the use of a test suite which could verify the changes are safe too?

A test will never catch every bug, otherwise it's a proof, and any change has the probability to introduce a new bug, irregardless of how careful you are. Thus, changing correct code will eventually result in incorrect code.

Re: Git: Introduce Rust and announce it will become mandatory in the build system

#145
post #101

Earlier quoted context omitted.

C is unsafe.

Changing well-tested code is unsafe.

not changing working code to prevent issues is unsafe.

we can go in circles all day with blanket statements that are all true. but we have ample evidence that even if we think some real-world C code is safe, it is often not because humans are extremely bad at writing safe C.

sometimes it's worth preventing that more strongly, sometimes it's not, evidently they think that software that a truly gigantic amount of humans and machines use is an area where it's worth the cost.

Re: Git: Introduce Rust and announce it will become mandatory in the build system

#146
post #94

Earlier quoted context omitted.

Shouldn't these platforms work on getting Rust to support it rather than have our tools limited by what they can consume? https://github.com/Rust-GCC/gccrs

A maintainer for that specific platform was more into the line of thinking that Git should bend over backwards to support them because "loss of support could have societal impact [...] Leaving debit or credit card authorizers without a supported git would be, let's say, "bad"." To me it looks like big corps enjoying the idea of having free service so they can avoid maintaining their own stuff, and trying the "too big…

It's additionally ridiculous because git is a code management tool. Maybe they are using it for something much more wild than that (why?) but I assume this is mostly just a complaint that they can't do `git pull` from their wonky architecture that they are building on. They could literally have a network mount and externally manage the git if they still need it.

It's not like older versions of git won't work perfectly fine. Git has great backwards compatibility. And if there is a break, seems like a good opportunity for them to fork and fix the break.

And lets be perfectly clear. These are very often systems built on top of a mountain of open source software. These companies will even have custom patched tools like gcc that they aren't willing to upstream because some manager decided they couldn't just give away the code they paid an engineer to write. I may feel bad for the situation it puts the engineers in, I feel absolutely no remorse for the companies because their greed put them in these situations in the first place.

Re: Git: Introduce Rust and announce it will become mandatory in the build system

#147

Earlier quoted context omitted.

My understanding: As Rust is built on LLVM and not GCC, it is also limited to operating systems supporting LLVM. GCC simply supports more platforms.

Rust has a GCC backend as well, rustc_codegen_gcc. However, the NonStop platform just has a proprietary C compiler.

MSVC is also proprietary. However LLVM is supported by Microsoft. The developer of Nonstop is apparently not doing that.

Re: Git: Introduce Rust and announce it will become mandatory in the build system

#148
post #131

Earlier quoted context omitted.

As a user, you may not be aware that C makes it relatively easy to create https://en.m.wikipedia.org/wiki/Buffer_overflow which are a major source of security vulnerabilities. This is one of the best reasons to rewrite software in Rust or any other more safe by default language.

Right, I never mentioned that I am a decently experienced C developer, so of course I got my fair share of buffer overflows and race conditions :) I have also learned some Rust recently, I find a nice language and quite pleasant to work with. I understand its benefits. But still, Git is already a mature tool (one may say "finished"). Lots of bugs have been found and fixed. And if more are found, sure it will be easie…

https://access.redhat.com/articles/2201201 and https://github.com/git/git/security/advisories/GHSA-4v56-3xv... are interesting examples to consider (though I'm curious whether Rust's integer overflow behavior in release builds would have definitely fared better?).

> Unless the end goal is to rewrite the whole thing in Rust piece by piece, solving hidden memory bugs along the way.

I would assume that's the case.

Re: Git: Introduce Rust and announce it will become mandatory in the build system

#149

Earlier quoted context omitted.

One argument from the git devs is that it’s very hard to implement smarter algorithms in C, though. For example, it uses arrays in places where a higher level language would use a hash, because the C version of that is harder to write, maintain, and debug. It’s also much easier to write correct threaded code in Rust than C. Between those 2 alone, using a more robust language could make it straightforward to add perfo…

That's a one time gain though. There's no reason for every platform to check the validity of some hash table implementation when that implementation is identical on all of them. In my opinion, the verification of the implementation should be separate from the task of translating that implementation to bytecode. This leaves you with a simple compiler that is easy to implement but still with a strong verifier that is h…

And who’s volunteering for that verification using the existing toolchain? I don’t think that’s been overlooked just because the git devs are too dumb or lazy or unmotivated.

Re: Git: Introduce Rust and announce it will become mandatory in the build system

#150
post #54

Maybe I'm just old and moany, and I need to step aside for bigger and better things such as Rust. But. Now rather than needing to understand just C to work on Git/kernel, you now need to also know Rust. The toolchain complexity is increasing, and the mix of these languages increases the barrier to entry. I'm highly invested into Git, having learned the tooling and having a significant number of projects constructed w…

> I'm just old and moany, and I need to step aside for bigger and better things such as Rust. You are. This is firm "I don't want to have to learn new things" territory, which isn't a viable attitude in this industry. In any case Rust is usually easier than C (excluding buggy C which is very easy to write), and certainly easier than actually learning the Git or Linux codebases.

[flagged]
Post reply on HN