git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [DISCUSS] Introducing Rust into the Git project

From
Patrick Steinhardt <ps@pks.im>
Date
Jan 11, 2024, 06:56 UTC
Message-ID
<ZZ-RH8L7H9vLcqoR@tanuki>
In-Reply-To
<CABPp-BGmXw0NQ8yBaMiVXHiKr0-Y_jkZWmJB1CG_oc4UGxt_gA@mail.gmail.com>
On Wed, Jan 10, 2024 at 09:06:23PM -0800, Elijah Newren wrote:
Show 44 quoted lines
> On Wed, Jan 10, 2024 at 6:57 PM <rsbecker@nexbridge.com> wrote:
> >
> > On Wednesday, January 10, 2024 9:21 PM, Elijah Newren wrote:
> > >On Wed, Jan 10, 2024 at 5:44 PM <rsbecker@nexbridge.com> 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
Previous: Elijah NewrenNext: rsbecker@nexbridge.com
Message 12 of 38 in “[DISCUSS] Introducing Rust into the Git project”
  1. Taylor BlauJan 10, 2024
  2. Dragan SimicJan 10, 2024
  3. Junio C HamanoJan 10, 2024
  4. rsbecker@nexbridge.comJan 10, 2024
  5. Taylor BlauJan 10, 2024
  6. rsbecker@nexbridge.comJan 10, 2024
  7. Elijah NewrenJan 11, 2024
  8. rsbecker@nexbridge.comJan 11, 2024
  9. Elijah NewrenJan 11, 2024
  10. rsbecker@nexbridge.comJan 11, 2024
  11. Elijah NewrenJan 11, 2024
  12. Patrick SteinhardtJan 11, 2024
  13. rsbecker@nexbridge.comJan 11, 2024
  14. brian m. carlsonJan 11, 2024
  15. rsbecker@nexbridge.comJan 11, 2024
  16. Trevor GrossJan 11, 2024
  17. rsbecker@nexbridge.comJan 11, 2024
  18. Trevor GrossJan 11, 2024
  19. Defining a platform support policy (Was: [DISCUSS] Introducing Rust into the Git project)Emily Shaffer, Jan 22, 2024
  20. rsbecker@nexbridge.comJan 23, 2024
  21. Junio C HamanoJan 23, 2024
  22. Junio C HamanoJan 23, 2024
  23. Elijah NewrenJan 24, 2024
  24. brian m. carlsonJan 10, 2024
  25. Elijah NewrenJan 11, 2024
  26. Dragan SimicJan 11, 2024
  27. Elijah NewrenJan 11, 2024
  28. Dragan SimicJan 17, 2024
  29. Elijah NewrenJan 24, 2024
  30. Dragan SimicJan 24, 2024
  31. Elijah NewrenJan 11, 2024
  32. Dragan SimicJan 11, 2024
  33. brian m. carlsonJan 11, 2024
  34. Sam JamesJan 11, 2024
  35. brian m. carlsonJan 11, 2024
  36. Sam JamesJan 12, 2024
  37. Antoni BoucherJan 12, 2024
  38. Trevor GrossJan 11, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.