On Wed, Jan 10, 2024 at 09:06:23PM -0800, Elijah Newren wrote: > On Wed, Jan 10, 2024 at 6:57 PM <rsbecker@xxxxxxxxxxxxx> wrote: > > > > On Wednesday, January 10, 2024 9:21 PM, Elijah Newren wrote: > > >On Wed, Jan 10, 2024 at 5:44 PM <rsbecker@xxxxxxxxxxxxx> wrote: > > >> > > >> On Wednesday, January 10, 2024 7:59 PM, Elijah Newren wrote: > > >[...] > > >> >Would you be okay with the following alternative: requiring that all > > >> >Rust code be optional for now? > > >> > > > >> >(In other words, allow you to build with USE_RUST=0, or something > > >> >like that. And then we have both a Rust and a C implementation of > > >> >anything that is required for backward compatibility, while any new > > >> >Rust-only stuff would not be included in your build.) > > >> > > >> To address the immediate above, I assume this means that platform > > >> maintainers will be responsible for developing non-portable > > >> implementations that duplicate Rust functionality > > > > > >This doesn't at all sound like what I thought I said. The whole proposal was so that > > >folks like NonStop could continue using Git with no more work than setting > > >USE_RUST=0 at build time. > > > > > >Why do you feel you'd need to duplicate any functionality? > > > > I think I misunderstood. What I took from this is that all new functionality would be in Rust, which would require a custom implementation in C for platforms that did not have Rust available - if that is even practical. Did I get that wrong? > > I think you somehow missed the word optional? > > I did say that new functionality should be allowed to be Rust only > (unlike existing functionality), but I'm not sure how you leaped to > assuming that all new functionality would be in Rust. Further, I also > don't understand why you jump to assuming that all new functionality > needs to be supported on all platforms. The point of the word > "optional" in my proposal is that it is not required. So, say, if > git-replay is in Rust, well you've never had git-replay before in any > release, so you haven't lost any functionality by it being implemented > in Rust. And existing things (merge, cherry-pick, rebase, etc.) > continue working with C-only code. But you may have one less optional > addition. > > At least that was _my_ proposal -- that Rust be optional for now. It > does differ from what I think Taylor was originally proposing, but > that's why I brought it up as an alternative proposal. There are two ways to do this that I can see: - New features may not be available on some platforms. I think this is what Elijah had in mind. - New features may require two implementations, one in C and one in Rust. I think this is what Randall understood. Ultimately, I think both alternatives would end up demoting platforms that do not support Rust to become second-class citizens eventually. This demotion is rather obvious in the case where new features may not be available. But I also think that the second approach, where we provide two implementations, would lead to a demotion of the Rust-less platform because the alternate implementation in C would likely end up receiving less attention than the Rust-based one. It's thus likely that the implementation receiving less attention will deteriorate in code quality. I also think that once we start to accept Rust code, it will only be a matter of time before we want to start using it in central code paths. Rust does provide interfaces which are a lot nicer to use than the C based ones, but it's hard to really reap the benefits unless we start to embrace Rust fully. Also, the most complex interfaces tend to be those which are deep inside our code base, like for example the object database. They are thus also the most profitable targets for a Rust conversion, even though likely also the hardest to realize. To me this feels like a slippery slope, and the deeper we go the more incentive we will have to drop platforms which do not support Rust altogether. So I can certainly see where Randall is coming from and why this proposal is not something that he is thrilled about. Patrick
Attachment:
signature.asc
Description: PGP signature