Remix.run Logo
glouwbug 3 hours ago

Maybe not then, but we basically have our own poor man's template system now:

    #define array(T, N) struct array##T##N { T value[N]; }

    void copy(array(int, 32)* x, array(int, 32)* y) {
        *x = *y;
    }

    int main() {
        array(int, 32) x;
        array(int, 32) y = { 1, 2, 3, 4 };
        copy(&x, &y);
    }
With (rumors of) lambdas and defer on the way, C is going the way of classic WoW.

https://en.wikipedia.org/wiki/C29_(C_standard_revision)

leptons 3 hours ago | parent | next [-]

>C is going the way of classic WoW

What does this mean?

omani 3 hours ago | parent [-]

it means C is going the way of classic World of Warcraft.

mid-kid 3 hours ago | parent [-]

What does that mean?

glouwbug 2 hours ago | parent [-]

WoW released a steady stream of expansions from 2004 to present day. At some point players wanted the old game, so Blizzard released WoW 2004, known as classic, in 2018, and reran the stream of expansions, stopping before any mass enshittification. You can draw the same parallels with C and C++, where C began picking the best from C++ in 1999, 2011, 2023, and soon to be 2029, and carving its own "classic" path.

We even have our Herb Sutter: Jens Gustedt

kllrnohj an hour ago | parent [-]

Except people aren't leaving C++ for C, if they're leaving it at all they're likely leaving it for Rust or some other memory safe language.

uecker an hour ago | parent [-]

Well, I was leaving C++ for C. I found this unburdened my mind from quite a lot of distracting complexity. For this reason, I am also not really tempted by Rust.

warmwaffles 3 hours ago | parent | prev [-]

I remember `defer` being up for consideration for the last consortium but it got yanked. Lambdas would definitely be nice to have.

glouwbug 3 hours ago | parent [-]

Seems like its in C29, but who knows. I've waited since 2009 for just about anything

warmwaffles 3 hours ago | parent [-]

C29 is shaping up to be some quality of life changes. And it looks like clang has a lot of it implemented already. GCC seems to be implementing some of them. `countof(thing)` seems handy so I don't have to define some constant and use them in both places.

glouwbug 2 hours ago | parent | next [-]

Not having to write

    #define len(x) sizeof(x) / sizeof(*x)
Is arguably the feature I've waited for for 20 years
uecker 2 hours ago | parent | prev [-]

GCC is usually ahead in terms of new C features.