Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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)

 help



Is the rumored lambda different from a normal function declaration in a bad way?

I think defer is good. It's a common type of control flow that's usually done with gotos and mistakes, and I'd say it's slightly less complex than the for loop syntax.


>C is going the way of classic WoW

What does this mean?


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

What does that mean?

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


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.

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.

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

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

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.

Not having to write

    #define len(x) sizeof(x) / sizeof(*x)
Is arguably the feature I've waited for for 20 years

GCC is usually ahead in terms of new C features.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: