From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 References: <807fabbc-e97a-4e60-1562-a126dd79008a@gmail.com> In-Reply-To: <807fabbc-e97a-4e60-1562-a126dd79008a@gmail.com> From: Charles Forsyth Date: Mon, 3 Sep 2018 02:03:37 +0100 Message-ID: To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary="00000000000027036d0574ed1dd9" Subject: Re: [9fans] Is Plan 9 C "Less Dangerous?" Topicbox-Message-UUID: e0974524-ead9-11e9-9d60-3106f5b1d025 --00000000000027036d0574ed1dd9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable The Plan 9 C compiler doesn't take an insane view of the meaning of "undefined behaviour", which makes a big difference. It also assumes you know how to write loops if they need to be fast (which frankly hasn't really mattered at the O/S level, esp on modern hardware), so it won't "optimise" essential code out of your program by miscalculating the ranges during "aggressive-loop-optimisation". No doubt it could be better, but it could easily be worse. The executable is also finite size, not unbounded-but-finite. For a compiler of a language the size and complexity of C (without some ANSI crud), I think it's not far off a size comparable to the language complexity (although it could be a bit smaller); meanwhile, by treating "compiling C" as a subset problem of "compiling C++", gcc and especially clang are vast whales whistling at the wrong frequency for the problem. On Sun, 2 Sep 2018 at 20:23, Iruat=C3=A3 Souza wrote: > On 09/02/2018 09:31 AM, Chris McGee wrote: > > I'm curious what > > tools are available to help discover bugs. > > > > Does simplicity and clarity count? > > --00000000000027036d0574ed1dd9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The Plan 9 C compiler doesn't take an insane view of t= he meaning of "undefined behaviour", which makes a big difference= .
It also assumes you know how to write loops if they need to be fast (= which frankly hasn't really mattered at the O/S level, esp on modern ha= rdware),
so it won't "optimise" essential code out = of your program by miscalculating the ranges during "aggressive-loop-o= ptimisation".
No doubt it could be better, but it could easi= ly be worse.
The executable is also finite size, not unbounded-bu= t-finite.
For a compiler of a language the size and complexity of= C (without some ANSI crud), I think it's not far off a size comparable= to the language complexity
(although it could be a bit smaller);= meanwhile, by treating "compiling C" as a subset problem of &quo= t;compiling C++", gcc and especially clang are vast whales whistling a= t the wrong frequency for the problem.

On Sun, 2 Sep 2018 at 20:23, Iruat=C3=A3 Souza <<= a href=3D"mailto:iru.muzgo@gmail.com">iru.muzgo@gmail.com> wrote:
On 09/02/2018 09:31 AM, Chris McGee w= rote:
> I'm curious what
> tools are available to help discover bugs.
>

Does simplicity and clarity count?

--00000000000027036d0574ed1dd9--