Deutsch English Français Italiano |
<vcb6bg$3c9qf$1@dont-email.me> 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: Terje Mathisen <terje.mathisen@tmsw.no> Newsgroups: comp.arch Subject: Re: Computer architects leaving Intel... Date: Tue, 17 Sep 2024 08:07:44 +0200 Organization: A noiseless patient Spider Lines: 37 Message-ID: <vcb6bg$3c9qf$1@dont-email.me> References: <2024Aug30.161204@mips.complang.tuwien.ac.at> <vbcob9$dvp4$1@dont-email.me> <vbd6ia$e0ld$2@dont-email.me> <UxpCO.174965$Hld5.7714@fx15.iad> <vc41rl$1fhjd$1@dont-email.me> <2024Sep14.152652@mips.complang.tuwien.ac.at> <d93c1dc0455692767c89ea9f7bd47ed1@www.novabbs.org> <vc4o0l$1kuqf$1@dont-email.me> <vc6vno$285g2$1@dont-email.me> <vc8qor$2od9v$1@dont-email.me> <vc99fi$2re3k$2@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Date: Tue, 17 Sep 2024 08:07:44 +0200 (CEST) Injection-Info: dont-email.me; posting-host="854a9c90e9fcaa895923e39b84a6c872"; logging-data="3549007"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19u+RXZggCN3kubA+rVunKtqJlU0LlXfxliRceOt/B7Wg==" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 SeaMonkey/2.53.19 Cancel-Lock: sha1:hRKRdWPzRq+JtS06QmEs6EIGFXk= In-Reply-To: <vc99fi$2re3k$2@dont-email.me> Bytes: 2514 David Brown wrote: > On 16/09/2024 10:37, Terje Mathisen wrote: >> This becomes much simpler in Rust where usize is the only legal index = >> type: >> >> Yeah, you have to actually write it as >> >> =C2=A0=C3=82=C2=A0 y =3D p[x]; >> =C2=A0=C3=82=C2=A0 x +=3D 1; >> >> instead of a single line, but this makes zero difference to the=20 >> compiler, right? >> >=20 > I don't care much about the compiler - but I don't think this is an=20 > improvement for the programmer.=C2=A0 (In general, I dislike trying to = do too=20 > much in a single expression or statement, but some C constructs are=20 > common enough that I am happy with them.=C2=A0 It would be hard to form= ulate=20 > concrete rules here.) >=20 > And the resulting object code is less efficient than you get with signe= d=20 > int and "y =3D p[x++];" (or "y =3D p[x]; x++;") in C. Is that true? I'll have to check godbolt myself if that is really the cas= e! Terje --=20 - <Terje.Mathisen at tmsw.no> "almost all programming can be viewed as an exercise in caching"