Re: Cray style vectors

Liste des GroupesRevenir à c arch 
Sujet : Re: Cray style vectors
De : tr.17687 (at) *nospam* z991.linuxsc.com (Tim Rentsch)
Groupes : comp.arch
Date : 11. Mar 2024, 16:11:05
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <868r2ost12.fsf@linuxsc.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
User-Agent : Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Terje Mathisen <terje.mathisen@tmsw.no> writes:

Terje Mathisen wrote:
>
Tim Rentsch wrote:
>
I'm always somewhat surprised when someone advocates using a cast
for such things, and now more surprised to learn that Rust has
chosen to impose using a cast as part of its language rules.  I
>
I am not _sure_ but I believe Rust will in fact verify that all such
casts are in fact legal, i.e. the data will fit in the target
container.
>
This is of course the total opposite of the C "nuclear option", and
much more like other languages that try to be secure by default.
>
Just to make sure I spoke to our resident Rust guru, and he told me I
was wrong:
>
Rust does have conversion operators/functions for downsizing
variables, and they come with full validity checking, but using "s as
u8" as I suggested will generate exactly the same code as a C
"(uint8_t) s" idiom, i.e. no verification and no safety checks.

Perfect. ;)

Date Sujet#  Auteur
11 Mar 24 o Re: Cray style vectors1Tim Rentsch

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal