Deutsch English Français Italiano |
<20240322170425.543@kylheku.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Kaz Kylheku <433-929-6894@kylheku.com> Newsgroups: comp.lang.c Subject: Re: A Famous Security Bug Date: Sat, 23 Mar 2024 00:09:46 -0000 (UTC) Organization: A noiseless patient Spider Lines: 44 Message-ID: <20240322170425.543@kylheku.com> References: <bug-20240320191736@ram.dialup.fu-berlin.de> <20240320114218.151@kylheku.com> <20240321211306.779b21d126e122556c34a346@gmail.moc> <utkea9$31sr2$1@dont-email.me> <utktul$35ng8$1@dont-email.me> <875xxdzvxj.fsf@nosuchdomain.example.com> Injection-Date: Sat, 23 Mar 2024 00:09:46 -0000 (UTC) Injection-Info: dont-email.me; posting-host="bc8ead67574eda43cc8acb80cc4a36a2"; logging-data="3396061"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/R4qB7/NrgkBr6hsaGt1q/fudUZ4tNvNs=" User-Agent: slrn/pre1.0.4-9 (Linux) Cancel-Lock: sha1:Rfn5gtReileWhhBWWsiLgv5XB8s= Bytes: 2725 On 2024-03-22, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote: > bart <bc@freeuk.com> writes: >> On 22/03/2024 17:14, James Kuyper wrote: > [...] >>> If you want to tell a system not only what a program must do, but >>> also how it must do it, you need to use a lower-level language than >>> C. >> >> Which one? > > Good question. > >> I don't think anyone seriously wants to switch to assembly for the >> sort of tasks they want to use C for. > > Agreed. What some people seem to be looking for is a language that's > about as portable as C, but where every language construct is required > to result in generated code that performs the specified operation. > There's a lot of handwaving in that description. "C without > optimization", maybe? > > I'm not aware that any such language exists, at least in the mainstream > (and I've looked at a *lot* of programming languages). I conclude that > there just isn't enough demand for that kind of thing. I think you can more or less get something like that with the following strategy: - all memory accesses through pointers are performed as written. - local variables are aggressively optimized into registers. - basic optimizations: - constant folding, dead code elimination. - basic control flow ones: jump threading and the like. - basic data flow optimizations. - peephole, good instruction selection. In that environment, the way the programmer writes the code is the rest of the optimization. Want loop unrolling? Write it yourself. -- TXR Programming Language: http://nongnu.org/txr Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal Mastodon: @Kazinator@mstdn.ca