From nobody Fri Sep 06 08:25:13 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 4X0Tn80PHFz5WLC4 for ; Fri, 06 Sep 2024 08:25:16 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0Tn75zGbz4c9Q; Fri, 6 Sep 2024 08:25:15 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Authentication-Results: mx1.freebsd.org; none Received: from critter.freebsd.dk (unknown [192.168.55.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by phk.freebsd.dk (Postfix) with ESMTPS id AF4C88928B; Fri, 06 Sep 2024 08:25:13 +0000 (UTC) Received: (from phk@localhost) by critter.freebsd.dk (8.18.1/8.16.1/Submit) id 4868PDWO042319; Fri, 6 Sep 2024 08:25:13 GMT (envelope-from phk) Message-Id: <202409060825.4868PDWO042319@critter.freebsd.dk> To: David Chisnall cc: Alan Somers , Dmitry Salychev , Jan Knepper , freebsd-hackers@freebsd.org Subject: Re: The Case for Rust (in any system) In-reply-to: <4E4FB8CC-A974-42C4-95D5-2E1E4BF681AD@freebsd.org> From: "Poul-Henning Kamp" References: <202409060725.4867P3ul040678@critter.freebsd.dk> <4E4FB8CC-A974-42C4-95D5-2E1E4BF681AD@freebsd.org> 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 Content-Type: text/plain; charset="UTF-8" Content-ID: <42317.1725611113.1@critter.freebsd.dk> Content-Transfer-Encoding: quoted-printable Date: Fri, 06 Sep 2024 08:25:13 +0000 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:1835, ipnet:130.225.0.0/16, country:EU] X-Rspamd-Queue-Id: 4X0Tn75zGbz4c9Q -------- David Chisnall writes: > On 6 Sep 2024, at 08:25, Poul-Henning Kamp wrote: > > > > I will also note that almost all the blame for C's current status > > lies with the standardization efforts, which almost seem hell-bent > > on destroying the language rather than improving it. > > As someone who is involved with C++ standardisation and so periodically = hears > things from WG14, my impression is that the people who care about the th= ings > that you list have all moved to C++, [=E2=80=A6] I've heard that from other sources too, strangely also from somebody quite active in the C standardization process, but no sane (to my mind) rationale was provided for this state of things. The C-stewardship situation has become increasingly intolerable to me, and I have practically already made up my mind, that Varnish Cache will migrate to a defined subset of C++, roughly corresponding to where I think C should have been by now. In one experiment, I wrapped the C-code in: #ifdef __cplusplus extern "C" { #endif and compiled it with a C++ compiler. Given that we have tried to dial code quality to 11 in Varnish, the number of relevant observations by the C++ compiler was a devastating indictment of how badly the C language has been let down by it's stewards. I'm not saying FreeBSD should think along the same lines, but FreeBSD should totally think along those same lines: Even if we stick with pure C-code, the C++ std-people have a much more sane approach to it's proper compilation that the C std-people. And there are nice features in C++ which do not make the source code unreadable. Poul-Henning -- = Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe = Never attribute to malice what can adequately be explained by incompetence= .