Re: The Case for Rust (in the base system)

From: Alexey Dokuchaev <danfe_at_freebsd.org>
Date: Mon, 22 Jan 2024 06:38:40 UTC
On Sun, Jan 21, 2024 at 07:51:32AM +0000, Poul-Henning Kamp wrote:
> ...
> But after I read this entire thread, the "pro" argument for Rust
> seems boil down to just "all the cool kids do it".
> 
> That exact same argument was used for "Perl in base" and "Java in
> base" previously, and if we hadn't dodged those bullets, we wouldn't
> be here today.

+1.  And Perl even didn't need to bootstrap itself with itself or
specific version of LLVM which takes ages to build and/or ~200GB of
tmpfs space.  My computer at work has only 4GB of RAM and I still
want to build and run modern FreeBSD on it.

While I generally do not oppose the idea of (re)writing parts of the
system in better, safer language, anything which itself is not written
in C/C++ (or can bootstrap itself from scratch in minutes) should not
be taken seriously.

> I will also "second" the comment about C++ getting to be a really
> good language, in particular if you play it like a violin:
> 
> 	Just because you /paid/ for the entire bow, doesn't mean you
> 	have to /play/ the entire bow.
> 
> So rather than jump onto this or some other hypewagon-of-the-year,
> only to regret it some years later and having to repay the technical
> debt with interest to get it out of the tree again, I propose that
> we quietly and gradually look more and more to C++ for our "advanced
> needs".

Right.  FWIW, had evolved significantly over the last 20 years and
gained a lot in the safety department with proper ownership (move)
semantics, new reference/smart pointer types, lambdas, etc. to the
extent its author claims that it's no less safe than Rust now*.

> I also propose, that next time somebody advocates for importing
> some "all the cool kids are doing it language" or other, we refuse
> to even look at their proposal, until they have proven their skill
> in, and dedication to, the language, by faithfully reimplementing
> cvsup in it, and documented how and why it is a better language for
> that, than Modula-3 was.

As always, Poul-Henning just nails it.  Well said!

./danfe

*) https://developers.slashdot.org/story/23/01/21/0526236/rust-safety-is-not-superior-to-c-bjarne-stroustrup-says