Live data from Hacker News

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

lore.kernel.org

231–240 of 433 posts

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

#231
post #228
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.

> Actually, the Rust toolchain makes cross-compiling way easier than any other fully-compiled language I've ever used Zig takes the crown on that one, to the point that some people use Zig to cross-compile Go projects with CGo dependencies.

The way Zig solves this problem "better" than Rust is by claiming the target libraries as part of its distribution and building those on demand. It makes for a really excellent experience cross-building.

Rust might have a harder time if it wanted a corresponding feature because it doesn't natively build C like Zig does (using libclang). Either it would have to start using libclang or ship with rust re-implementations of the C library. AFAIK it's impossible to write the C++ library in Rust though.

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

#232
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…

Im on the same boat :) But no worries. You can always build and use older git without rust. Of course, it will work for a while until those kids will change the proto for the "better". And being old and grumpy also means, you can slowly care less and less about all that moot :)

Kids: now downvote it into oblivion :) Like I give a shit...

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

#233
post #47
post #41

Earlier quoted context omitted.

Do you think any new, Git-relevant platform is going to gain C compiler support via anything other than Clang/LLVM?

In theory you should be able to use TCC to build git currently [1] [2]. If you have a lightweight system or you're building something experimental, it's a lot easier to get TCC up and running over GCC. I note that it supports arm, arm64, i386, riscv64 and x86_64. [1] https://bellard.org/tcc/ [2] https://github.com/TinyCC/tinycc

> I note that it supports arm, arm64, i386, riscv64 and x86_64.

But like, so does LLVM.

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

#234
post #41

Earlier quoted context omitted.

Do you think any new, Git-relevant platform is going to gain C compiler support via anything other than Clang/LLVM?

Code doesn't need to "gain C compiler support", that's the point of having a language standard.

Someone has to write the platform-specific backend. A language standard doesn't help you if nothing implements it for your new platform.

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

#235
What's the point of trying to introduce Rust everywhere? Git is a mature piece of software and I doubt a lot of new code needs to be written. Also, Rust is very complex relative to C. If you really need classes, templates, etc, you can stick to C++ 98 and get something that is still clean and understandable relative to recent C++ standards and Rust.

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

#236

Earlier quoted context omitted.

> 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]

Rust is over 10 years old now. It has a track record of delivering what it promises, and a very satisfied growing userbase.

OTOH static analyzers for C have been around for longer than Rust, and we're still waiting for them to disprove Rice's theorem.

AI tools so far are famous for generating low-quality code, and generating bogus vulnerability reports. They may eventually get better and end up being used to make C code secure - see DARPA's TRACTOR program.

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

#237
I suggest waiting till the gcc side matures, with the minimum of a working gcc frontend for a non optional dependency. Optional dependencies with gcc_codegen might be okay. Git is pretty core to a lot of projects, and this change is risky, it's on a fairly short time frame to make it a core dep (6 months?).

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

#238
post #219

Earlier quoted context omitted.

As said before I wasn't complaining about windows, but rather of not so common posix layers like cygwin [0]. Most C posix compliant stuff compiles in my experience. [0] https://github.com/rust-lang/rust/issues/137819

Right, but Rust makes it so you don't have to use Cygwin. It's one of the great portability advantages of Rust that you can write real Windows programs with it.

I am not really sure if I can follow here. How could a rust compiled program like git honor my cygwin emulated mount points in paths, which I need, when working with other posix compliant software.

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

#239
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…

Removing Perl and adding Rust instead is probably reducing complexity rather than increasing it.

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

#240

Is this a bit of chickens coming home to roost as far as developer culture forgetting how to work with cross-compiling toolchains? When I started my career, it was common understanding that the developer may be manipulating sourcecode on a different system and/or platform than where it will be executed. Our source control, editing, compilation, and execution was understood to happen in different computational spaces,…

> Is this a bit of chickens coming home to roost as far as developer culture forgetting how to work with cross-compiling toolchains?

I don't understand your comment. Completely ignorning Rust the modern state of cross-compilation is an unmitigated disaster.

Linux is especially bad because glibc is badly architected pile of garbage stuck in the 80s. It should be trivially possible to target any minimum glibc version for any possible Linux hardware environment. But glibc and Linux distros don't even attempt to make this possible. Linux toolchains make it nearly impossible to not use the default system libraries which is the opposite of correct for cross-compiling.

Zig moves mountains to make cross-compiling possible. But almost no projects actually attempt to support cross-compile.

Post reply on HN