Path: csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.arch
Subject: Re: Optimization by programmers
Date: Tue, 29 Sep 2026 15:44:56 -0700
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <86y0cjpthz.fsf@linuxsc.com>
References: <1177fdi$26ea4$1@dont-email.me> <2026Sep19.082513@mips.complang.tuwien.ac.at> <2026Sep21.191719@mips.complang.tuwien.ac.at> <118tshf$r2kv$1@dont-email.me> <118uv1g$18lk0$1@dont-email.me> <86pky4rpmb.fsf@linuxsc.com> <1193dsi$2pbdi$1@dont-email.me> <868q4qsjdy.fsf@linuxsc.com> <11969ba$3lmsq$5@dont-email.me> <119b6fd$1buj2$1@dont-email.me> <20260927181805.0000132e@yahoo.com> <119bepl$1fl0g$1@dont-email.me> <20260927194301.0000194f@yahoo.com> <86mrt2r33i.fsf@linuxsc.com> <119btc7$1n32h$1@dont-email.me> <86bj9hr91x.fsf@linuxsc.com> <20260928195833.00001d42@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Date: Tue, 29 Sep 2026 22:44:59 +0000 (UTC)
Injection-Info: dont-email.me; logging-data="3893094"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+4tZgGQVwVgjtcsej/mgPj4+wGBt6Jj7s="; posting-host="6296a4278ffab0fbbf1eadbbdc6604eb"
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:CyxFXitmsczv5nZDu9WBUytP1gw= sha1:FRsMBOoh827L7XREH0jNHgx10oo= sha256:qv22k93stNwpWlfogawi/8JWQOehoqi+RxVqi74diOw= sha1:JRpvronFw6eDdVrPcdDK+cvz86M= sha256:9HMmc23NBgmI6Algtqh5tqSE0rdrJctD+R8zy0iwBs8=
Xref: csiph.com comp.arch:118329
Michael S writes:
> On Mon, 28 Sep 2026 02:59:06 -0700
> Tim Rentsch wrote:
>
>> Terje Mathisen writes:
>>
>>> Tim Rentsch wrote:
[...]
>>>> I favor a type equivalent to size_t for use as array index
>>>> variables.
>>>
>>> In Rust, the only acceptable array index is of type "usize", which
>>> is effectively the same as u64 on most platforms these days, but
>>> does not need to be so: On a 32-bit target, it would be the same
>>> as u32.
>>>
>>> So effectively very similar to size_t.
>>
>> Maybe that limitation works okay in Rust. In C sometimes it's
>> important to allow a signed value for indexing. Probably 99% of
>> the time size_t is good, but not always.
>
> My only Rust program was full of casts of various integer types to
> usize. Exactly for the purpose of array indexing.
That tells me a lot. Thank you.