Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Sep 2024 09:24:34 -0400
From:      Jan Knepper <jan@digitaldaemon.com>
To:        Poul-Henning Kamp <phk@phk.freebsd.dk>, David Chisnall <theraven@freebsd.org>
Cc:        Alan Somers <asomers@freebsd.org>, Dmitry Salychev <dsl@freebsd.org>, freebsd-hackers@freebsd.org
Subject:   Re: The Case for Rust (in any system)
Message-ID:  <c843feef-4069-44a7-b2f7-5200556c0fb5@digitaldaemon.com>
In-Reply-To: <202409060825.4868PDWO042319@critter.freebsd.dk>
References:  <202409060725.4867P3ul040678@critter.freebsd.dk> <4E4FB8CC-A974-42C4-95D5-2E1E4BF681AD@freebsd.org> <202409060825.4868PDWO042319@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
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<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
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    On 9/6/24 04:25, Poul-Henning Kamp wrote:<br>
    <blockquote type="cite"
      cite="mid:202409060825.4868PDWO042319@critter.freebsd.dk">
      <pre class="moz-quote-pre" wrap="">--------
David Chisnall writes:
</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">On 6 Sep 2024, at 08:25, Poul-Henning Kamp <a class="moz-txt-link-rfc2396E" href="mailto:phk@phk.freebsd.dk">&lt;phk@phk.freebsd.dk&gt;</a> wrote:
</pre>
        <blockquote type="cite">
          <pre class="moz-quote-pre" wrap="">
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.
</pre>
        </blockquote>
        <pre class="moz-quote-pre" wrap="">
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++, […]
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">
...</pre>
    </blockquote>
    <blockquote type="cite"
      cite="mid:202409060825.4868PDWO042319@critter.freebsd.dk">
      <pre class="moz-quote-pre" wrap="">
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.

</pre>
    </blockquote>
    Second this.<br>
    <br>
    Not surprised... <br>
    <br>
    I have done this as long as C++ as been around and it always made
    for better code in the end.<br>
    <br>
    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.<br>
    <br>
    Jan<br>
    <br>
  </body>
</html>

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?c843feef-4069-44a7-b2f7-5200556c0fb5>