From nobody Sat Jan 20 22:35:30 2024 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4THWXY6h2mz57fnw for ; Sat, 20 Jan 2024 22:35:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4THWXY3cDrz54ff for ; Sat, 20 Jan 2024 22:35:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-55a43f9a6c1so2006051a12.1 for ; Sat, 20 Jan 2024 14:35:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1705790140; x=1706394940; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=TeqEA6JaFkOuJPzcOyO+N5ZIZ+NQFQD+juhIpuCc8N8=; b=FhEk5oORNgylV2HkRsNNr26vnZzZDxbCabTVYSzewdyuCsJUA0n0b0Vt0MVdRrmp18 TtoQm56orXoJX4V8l22sU6vW29DbJln7MeUqPIkpBX1JfeEuEs2ZAJppeDru043z+KGg Diopf/VzP0leKzDa6VFNgGvprsAN/hmF+dCVJj5rlsB6yecGI043GuaPUveeE89T5V4q ZCWkICoJG/Yf4ntcoxG7ytjQjqLDYF+ZGF1p09Wb+C8CvI4s+ohkC/jmb8A1Ep+QngfF BjUesTd7rq7fMiMKqKMye7qFb4XJlO4M9PKlAB8kdmU7BSA72kH4FGJ8Tjw3WM/qpa4S w7xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705790140; x=1706394940; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=TeqEA6JaFkOuJPzcOyO+N5ZIZ+NQFQD+juhIpuCc8N8=; b=YR8lwzksgmzKLFUJHcE5h0eEKIV10YLmW3/tnRpUmqkD2ZIK/9wFgM1dyMQkgsuB8g JeVS08D9eSvqOhW0dRaQs1lmQ5IXViz8jI5oEvih/7o+V8r91ww7FMvvANalXgwNMek6 Htb1AKVE3mA3tFOIkshXrnAdOR3lf1UEgziWZSaiZQysfbemwKo3KD6smsDfAF4L6lxz wSsUK6Zfv+vlPjRwIxcO9FZyaxlS1xo+wpbmYCgdSDtNklkSvT9lnCeFf2SpyRfSma3v GEfvik2RkIFi62ftLBwFbnFq8PEOT6ij8oMnXY1bdOk+lq2x9nXz2/obSrZVwnat+lqz R2/Q== X-Gm-Message-State: AOJu0YwfM0II8ZWrBC61vcgLP5kkNGL/2h/8GHGzo9w8KE23s08IM2kC ET5g64748JmmararHu7qj59AYPISb4Tw98WHMq52yzT9FdOiKc+V0ZlbCe3DAJerQ13+mN9fcw9 kJUrOlkO1hkstyEDLYiRwXmWWAe/4K5BsjvOr5Q== X-Google-Smtp-Source: AGHT+IGnHzBMvwuQw3ORXbDULOhWbPAhg6pXLh/N4P4sechho2IFr6+lem2UJEfZ3W1BkwY5oQYl1k6D8/Z93g9/3hY= X-Received: by 2002:a05:6402:30a7:b0:55a:181:a1e9 with SMTP id df7-20020a05640230a700b0055a0181a1e9mr1149525edb.69.1705790139575; Sat, 20 Jan 2024 14:35:39 -0800 (PST) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 References: In-Reply-To: From: Warner Losh Date: Sat, 20 Jan 2024 15:35:30 -0700 Message-ID: Subject: Re: The Case for Rust (in the base system) To: Charlie Li Cc: Gleb Popov , Alan Somers , FreeBSD Hackers , Scott Long , "Goran Meki??" Content-Type: multipart/alternative; boundary="00000000000054c36d060f683774" X-Rspamd-Queue-Id: 4THWXY3cDrz54ff X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] --00000000000054c36d060f683774 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Jan 20, 2024 at 11:25=E2=80=AFAM Charlie Li w= rote: > Warner Losh wrote: > > > > > > On Sat, Jan 20, 2024, 10:14=E2=80=AFAM Gleb Popov wrote: > > > > On Sat, Jan 20, 2024 at 7:51=E2=80=AFPM 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 fr= om > > 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 --00000000000054c36d060f683774 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sat, Jan 20, 2024 at 11:25=E2=80= =AFAM Charlie Li <vishwin@freebsd= .org> wrote:
Warner Losh wrote:
>
>
> On Sat, Jan 20, 2024, 10:14=E2=80=AFAM Gleb Popov wrote:
>
>=C2=A0 =C2=A0 =C2=A0On Sat, Jan 20, 2024 at 7:51=E2=80=AFPM Alan Somers= wrote:
>=C2=A0 =C2=A0 =C2=A0 > To
>=C2=A0 =C2=A0 =C2=A0 > summarize, the cost is that it would double o= ur build times.
>
>=C2=A0 =C2=A0 =C2=A0Would it? From what I remember, a lot of rust's= build time comes from
>=C2=A0 =C2=A0 =C2=A0building its own LLVM. Can we reuse our base LLVM f= or Rust-in-base?
>
>
> No. That's not possible in general.=C2=A0 Rust needs its own speci= al 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 velocit= y coupled with narrow compatibility bands would
be a bit of an im= pedance mismatch with the project. That's why I said it
isn&#= 39;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 sugg= esting 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).=C2=A0 That way, there's
not pe= r-se dependency in base on this and we'd get a feel for how that
<= div>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 rand= om).
Until there's a way to reproducibly built programs, I ma= intain that it's
too early to talk about rust compiler in bas= e.

Warner
--00000000000054c36d060f683774--