News for hackers. Stuff that matters.
Re:Checked C by thayne on Thursday December 22, 2022 @12:46AM (#34090244)
I really want C to have a slice/fat-pointer-array type, because C is the least common denominator for ABIs and any kind of FFI, and since it doesn't have something like that, it complicates FFI from languages that have a more sane way of handling arrays.

I'd even be happy if the standard just included a macro like:

#define ARRAY(T) struct { T *ptr, size_t len }

Along with a few functions for working with such types.

Although that would be kind of unwieldy to use in C, since you would need a typedef to actually use any specific types.

Re:Checked C by uecker on Friday December 23, 2022 @05:53PM (#34111524)
I am relatively sure we will end up adding a fat pointer next round.

So long, you can look at my experiments using a struct type here: https://github.com/uecker/noplate/

The typedef thing will go away with C2X where you do this in place.