Sujet : Re: A Famous Security Bug
De : bc (at) *nospam* freeuk.com (bart)
Groupes : comp.lang.cDate : 25. Mar 2024, 00:07:44
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <utqbo0$kvt3$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12
User-Agent : Mozilla Thunderbird
On 24/03/2024 20:49, Keith Thompson wrote:
bart <bc@freeuk.com> writes:
[...]
But what people want are the conveniences and familiarity of a HLL,
without the bloody-mindedness of an optimising C compiler.
[...]
Exactly which people want that?
The evidence suggests that, while some people undoubtedly want that (and
it's a perfectly legitimate desire), there isn't enough demand to induce
anyone to actually produce such a thing and for it to catch on.
Developers have had decades to define and implement the kind of language
you're talking about. Why haven't they?
Perhaps many settle for using C but using a lesser C compiler or one with optimisation turned off.
The language still has the UBs of C, whereas people want it more implementation-defined, but a weaker compiler is less likely to leverage that UB to do unexpected things or to wreck somebody's expections of how a piece of code will behave.
With the dominance of C it's hard to produce a competing language, especially it it looks like C. And people still want all the optimisations that are possible without taking advantage of UB of needing to delete chunks of the user's code.
This is probably a similar discussion to that of makefiles; why isn't there a competing build system?
C is often used as an intermediate language by compilers. There is a source language where a lot of this stuff is well-defined by its spec. There is a known target, or a small range of targets, on which the behaviour is also well-defined.
However, in the middle you have C, where much of it isn't well-defined! People want a language which is like the hypothetical one discussed, one that doesn't get 'in the way' with its crazy ideas. But now it's either going to be a lot work to generate C code that behaves as expected, or they have to settle for a non-optimising compiler and cross their fingers.