News for hackers. Stuff that matters.
Re:My personal C coding style as of late 2023 by stephc_int13 on Monday October 09, 2023 @10:33AM (#37820846)
Long Long is ridiculous and often confusing.

Now, what about SIMD types?

What about 16bits floats?

Using the short size convention we have easy and logical answers.

The reason why new languages like Rust and Zig are using those conventions is not random, types naming (and stdlib) is a weak point of C (and C++).

Luckily they are not set in stone, we can choose different and reasonable conventions.

Re:My personal C coding style as of late 2023 by sovande on Monday October 09, 2023 @11:37AM (#37821527)
> Long Long is ridiculous and often confusing

It might be ridiculous, but it’s hardly confusing for a C programmer. But, yeah in and ideal world ‘long’ should just be defined as 64 bits

Re:My personal C coding style as of late 2023 by WalterBright on Monday October 09, 2023 @02:44PM (#37823749)
I use `halffloat` for 16 bit floats. But be careful, there are several different encodings of 16 bit floats, so float16 isn't enough in and of itself.

SIMD types in D are done with:

    __vector(byte[16]), __vector(int[8])
and an alias (typedef for the C folk) for this is commonly used, like `byte16` and `int8`.