From nobody Fri Sep 06 13:24:34 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 4X0cQX2Fstz5V3Xg for ; Fri, 06 Sep 2024 13:24:36 +0000 (UTC) (envelope-from jan@digitaldaemon.com) Received: from digitaldaemon.com (digitaldaemon.com [162.217.114.50]) by mx1.freebsd.org (Postfix) with SMTP id 4X0cQX0Xzwz4Jxh for ; Fri, 6 Sep 2024 13:24:36 +0000 (UTC) (envelope-from jan@digitaldaemon.com) Authentication-Results: mx1.freebsd.org; none Received: (qmail 36742 invoked by uid 89); 6 Sep 2024 13:24:35 -0000 Received: from c-69-142-153-99.hsd1.nj.comcast.net (HELO ?10.0.0.22?) (jan@digitaldaemon.com@69.142.153.99) by digitaldaemon.com with SMTP; 6 Sep 2024 13:24:35 -0000 Content-Type: multipart/alternative; boundary="------------PysUyqlcn00h7wlpA7Bl3Qqg" Message-ID: Date: Fri, 6 Sep 2024 09:24:34 -0400 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 User-Agent: Mozilla Thunderbird Subject: Re: The Case for Rust (in any system) To: Poul-Henning Kamp , David Chisnall Cc: Alan Somers , Dmitry Salychev , freebsd-hackers@freebsd.org References: <202409060725.4867P3ul040678@critter.freebsd.dk> <4E4FB8CC-A974-42C4-95D5-2E1E4BF681AD@freebsd.org> <202409060825.4868PDWO042319@critter.freebsd.dk> Content-Language: en-US From: Jan Knepper In-Reply-To: <202409060825.4868PDWO042319@critter.freebsd.dk> 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:36236, ipnet:162.217.112.0/22, country:US] X-Rspamd-Queue-Id: 4X0cQX0Xzwz4Jxh This is a multi-part message in MIME format. --------------PysUyqlcn00h7wlpA7Bl3Qqg Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 9/6/24 04:25, Poul-Henning Kamp wrote: > -------- > 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 things >> that you list have all moved to C++, […] > ... > 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. > Second this. Not surprised... I have done this as long as C++ as been around and it always made for better code in the end. Truly, this is one of the easy things that could be done with FreeBSD code, and probably would help quite a bit improving the code. Jan --------------PysUyqlcn00h7wlpA7Bl3Qqg Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit On 9/6/24 04:25, Poul-Henning Kamp wrote:
--------
David Chisnall writes:
On 6 Sep 2024, at 08:25, Poul-Henning Kamp <phk@phk.freebsd.dk> 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 things
that you list have all moved to C++, […]
...
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.

Second this.

Not surprised...

I have done this as long as C++ as been around and it always made for better code in the end.

Truly, this is one of the easy things that could be done with FreeBSD code, and probably would help quite a bit improving the code.

Jan

--------------PysUyqlcn00h7wlpA7Bl3Qqg--