Re: The Case for Rust (in the base system)
- In reply to: Charlie Li : "Re: The Case for Rust (in the base system)"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 20 Jan 2024 22:35:30 UTC
On Sat, Jan 20, 2024 at 11:25 AM Charlie Li <vishwin@freebsd.org> wrote: > Warner Losh wrote: > > > > > > On Sat, Jan 20, 2024, 10:14 AM Gleb Popov wrote: > > > > On Sat, Jan 20, 2024 at 7:51 PM Alan Somers wrote: > > > To > > > summarize, the cost is that it would double our build times. > > > > Would it? From what I remember, a lot of rust's build time comes from > > building its own LLVM. Can we reuse our base LLVM for Rust-in-base? > > > > > > No. That's not possible in general. Rust needs its own special thing > > that is not well tested fit the non rust case. > > > Rust has followed vanilla LLVM since 8.0 and they have supported the > external LLVM path since then. However, they use the shared library, LIT > and a few other extras, all of which we don't build or include in base. > They also have narrow LLVM version support windows, with only LLVM 15 > and later supported on Rust 1.74 and later. Further, release cycles are > about every month, which maybe unless we stick strictly to Editions > (language standards like C11, C++17, et al), sound like a problem for > -RELEASEs. > Yea, Rust's fast velocity coupled with narrow compatibility bands would be a bit of an impedance mismatch with the project. That's why I said it isn't possible in general (one of many reasons, the one I cited actually being obsolete it sounds). IT's the main reason why I'm suggesting that if we want rust in the base, it should be done via an external toolchain that the rust advocates would maintain via a port (just like the folks that want FreeBSD building via gcc have similar external toolchains). That way, there's not per-se dependency in base on this and we'd get a feel for how that works in practice as time passes and we have code on stable branches that needs to continue to work (to pick one potential issue at random). Until there's a way to reproducibly built programs, I maintain that it's too early to talk about rust compiler in base. Warner