News for hackers. Stuff that matters.
Re:What Makes the Zig Programming Language Unique? by WalterBright on Thursday October 06, 2022 @03:03PM (#33112546)
Ok, try this one:

    string cat(string s) {
        return "int " ~ s ~ ";";
    }

    int test() {
        mixin(cat("i"));
        return i + 3;
    }
Re:What Makes the Zig Programming Language Unique? by pjmlp on Thursday October 06, 2022 @04:30PM (#33113678)
For that one D gets one point, even though Circle C++ might be able to do it, it isn't ISO C++.

So what if D wins at code golf against C++?

What matters is being good enough for most compile time use cases, while enjoying the large ecosystem and IDE tooling, perfect is the enemy of good.

Re:What Makes the Zig Programming Language Unique? by WalterBright on Thursday October 06, 2022 @11:22PM (#33117072)
The ability to use CTFE to generate strings that can then be fed back into the compiler is a heavily used feature, not just a golf point. It enables the creation of mini-DSLs.
Re:What Makes the Zig Programming Language Unique? by pjmlp on Friday October 07, 2022 @09:00AM (#33120649)
You tend to praise D features, while ignoring that a language on its own doesn't make an ecosystem.

Indeed C# and C++ don't give me all nice features from D, when doing language comparison tables, D wins on that table listing.

Yet they give me their library ecosystem, graphical IDEs, and first day avail on any major company SDK.

I will take that productivity win over the few features that the D language happens to have.

Why is Andrei Alexandrescu helping to improve C++ at NVidia instead of using D, when the language is so great?

Ecosystem, that is why.