Live data from Hacker News

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

lore.kernel.org

281–290 of 433 posts

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

#281

Earlier quoted context omitted.

I don't know what this has to do with locking down phones, but I do appreciate not getting compromised just for cloning a repo or opening my laptop at a coffee shop.

Who says you do not? :)

Oh, I think it's a real problem, that's why I'm in favor of improved tools.

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

#282

Earlier quoted context omitted.

I don't know what this has to do with locking down phones, but I do appreciate not getting compromised just for cloning a repo or opening my laptop at a coffee shop.

(There is a persistent idea that the lack of memory safety in C is good because it allows people to jailbreak their phones.)

Thanks, that take is... Something. I'm all for user-controllable hardware but I think that's a regulatory problem not a technical one.

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

#284

Earlier quoted context omitted.

That would be a stronger argument if people were facing implementation deficiencies in git

I'm not sure exactly what you mean but of course people are facing implementation deficiencies in Git. Last I checked submodules were still "experimental" and extremely buggy, and don't work at all with worktrees. (And yeah submodules suck but sometimes I don't have a choice.)

I mean I don’t encounter bugs when I use the program. So telling me rust is going to fix bugs is meh. A web browser is more interesting.

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

#286
post #261

Earlier quoted context omitted.

>> insisting on a closed C compiler in 2025. > Everything should use one compiler, one run-time and one package manager. If you think that calling out closed C compilers is somehow an argument for a single toolchain for all things, I doubt there's anything I can do to help educate you about why this isn't the case. If you do understand and are choosing to purposely misinterpret what I said, there are a lot of much st…

For various libs, you provide a way to build without it. If it's not auto-detected, or explicitly disabled via the configure command line, then don't try to use it. Then whatever depends on it just doesn't work. If for some insane reason git integrates XML and uses libxml for some feature, let it build without the feature for someone who doesn't want to provide libxml. > At the end of the day, there's a finite amount…

> Integrating Rust shows you have too much time on your hands; the people who are affected by that, not necessarily so.

As cited elsewhere in the this thread, the person making this proposal on the mailing list has been involved in significant contributions to git in the past, so I'd be inclined to trust their judgment about whether it's a worthwhile use of their time in the absence of evidence to the contrary. If you have something that would indicate this proposal was made in bad faith, I'd certainly be interested to see it, but otherwise, I don't see how you can make this claim other than as your own subjective opinion. That's fine, but I can't say I'm shocked that the people actually making the decisions on how to maintain git don't find it convincing.

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

#287

Earlier quoted context omitted.

> Now rather than needing to understand just C to work on Git/kernel, you now need to also know Rust. I'm yet to know a single software engineer who isn't well versed on multiple programming languages. This is not a problem.

Agreed. And if someone is interested in contributing to the Linux kernel, a new programming language is far from the hardest thing that they need to learn...

Rust will, in fact, make it significantly easier to contribute.

In C, you have to remember lots of rules of when what is safe and what locks to hold when. In Rust, APIs are structured to make unsafe use impossible without explicitly saying `unsafe`.

Concrete example: in Rust, locking a mutex returns a handle that lets you access the data protected by the mutex, and the mutex is unlocked when the handle is dropped.

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

#288
post #74
post #66

Earlier quoted context omitted.

They're proposing porting over one small piece that has no dependencies and exposing it to the rest of git via a C interface. Yes, they'll presumably port more over in the future if it goes well, but it's a gross exaggeration to characterize this as somehow making it impossible to contribute without knowing Rust.

I know that it is a "slippery slope" argument, but in the future, it will become more difficult to contribute without knowing Rust. That's the entire point of introducing it.

I guess in a certain sense, yes, the total number of lines of code in C will go down, so the difficulty of finding a place to contribute will go down by that metric. On the other hand, I'd argue that it seems rather unlikely that literally all of the C code will be gone from git at least over the next couple of decades (and that's assuming that there's even a desire to rewrite it entirely, which doesn't seem like it's anywhere close to even being possible to discuss seriously any time soon), so it seems like the amount of difficulty will be so small that it's a bit silly to worry about it. Keep in mind that there's still not anything stopping new code from being written in C just because new code might also be possible to write in Rust. Right now, it's literally impossible to contribute Rust code to git, so if it becomes infinitesimally harder to contribute C code to make contributing Rust code possible, that's still a arguably a much larger increase in the net "contributability" of the git codebase, for lack of a better term.

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

#289
post #132

Earlier quoted context omitted.

Actually, the Rust toolchain makes cross-compiling way easier than any other fully-compiled language I've ever used. There are like 100 different platforms you can target by just setting the `--target` flag, and they all pretty much just work on any host platform. Sounds like the real issue is that some Git developers have ancient, rigid requirements for their own development machines.

That has not been my experience. I develop on Windows and need to compile for Linux. After spending several hours trying to get cross-compilation working, I gave up and do it via WSL now. I switched from Go and I feel like Go was much better at this than Rust. (I tried “cross” but it was very slow and I found it faster to rsync the files inside the container and then run the build scripts)

I'd bet the difference is that Go has a default assumption that everything is reimplemented in Go and calling C is awkward and slow, meanwhile lots of low-level Rust libraries are actually just type-safety wrappers over C libraries.
Post reply on HN