Sujet : Re: Suggested method for returning a string from a C program?
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.lang.cDate : 20. Mar 2025, 22:10:39
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20250320140817.93@kylheku.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2025-03-20, Michael S <
already5chosen@yahoo.com> wrote:
On Thu, 20 Mar 2025 19:58:37 -0000 (UTC)
Kaz Kylheku <643-408-1753@kylheku.com> wrote:
>
It's an embarrassing blemish on Rust that they made their principal
integer types like this; it makes all Rust code look idiotically
hardware dependent. You can't code an abstract algorithm out of
Sedgewick, Knuth or Cormen in Rust without peppering the code with
distracting 32's and 64's.
>
If size suffixes make you nervous, Rust has equivalents of size_t and
ptrdiff_t. Named, respectively, usize and isize.
But you probably know it.
I do, and I've seen code using size and usize for quantities that are
not sizes of any kind. While it's better than a hardware depenendcy
like i64, it's terrible naming. Make an alias called "int"
for "size" and you're there.
-- TXR Programming Language: http://nongnu.org/txrCygnal: Cygwin Native Application Library: http://kylheku.com/cygnalMastodon: @Kazinator@mstdn.ca