Hacker News new | past | comments | ask | show | jobs | submit login

It really reads like the author just wants Zig.



The author is the creator of D, so he's probably fine with D. And D is something like 25 years old. Whereas Zig is just a toddler.


ahh, that explains the ImportC comparisons. Also didn't realize that person is also a regular on HN as well.


Zig copies features from D!


Imitation is the sincerest form of flattery.


Yup. D is the source for a number of recent features in other languages.

The reason I embarked on D is because C and C++ were too reluctant to move forward.


>The reason I embarked on D is because C and C++ were too reluctant to move forward.

I just want to take this opportunity to say thank you. While D may not taken up from the rest of the world. It has surely lived on in C, C++ and many other languages. Still wish more people would use Das C.


Yes, the influence is there.

For example, C++ pivoted to using ranges instead of iterators, and even C# changed their iterators to be like D's ranges (or so I've been told).


Do you think you will keep moving forward for the next decade or will you merge when c/cpp becomes similar enough to D ? Maybe your group still has tons of ideas that need their own space to grow.


The ideas for advancing D come thick and fast. C and C++ will never merge with D, because we have different philosophies of what makes for a great programming language.

For example, D will never have a preprocessor. Or over my dead body :-/


> For example, D will never have a preprocessor. Or over my dead body :-/

Indeed. Compile time evaluation combined with a preprocessor would make for some serious head scratching when it comes to trusting trust.


Thanks a lot for your answer, I have another one, what languages or topics do you follow for inspiration regarding concepts ?


I could spent 500% of my time studying other languages. So I don't, but the D user community isn't shy about doing that for me!


C++ is trying to eliminate the use of preprocessor. they can't get rid of it but you shouldn't use it.


I see revision after revision of Standard C++, and no progress in that direction. I (along with Andrei Alexandrescu and Herb Sutter) made a proposal to add D's static if feature to eliminate the need for #if. It was vehemently rejected.


Stroustrup has been saying that in print since 1993, and it hasn’t happened yet.


The biggest advance would be Microsoft adopt D.


I'm curious, is there any features, from any language, that you wish you had implemented, or want to copy, in D?


There's active work going on to add pattern matching. Just recently I completed the addition of move constructors. They are different from C++'s, and I bet they'll turn out to be much better.


Identity theft is not a joke, millions of families suffer every year!

Michael!


more importantly, though, zig deliberately doesnt implement a whole TON of things that D does.

sometimes parsimony is called for. zig is basically c--+ where the + is the constexpr stuff.


It keeps adding D features anyway, like constexpr.


the constexpr stuff has been around since the beginning[0]. concretely, what other thing from D do you claim zig has added since?

[0] minimally 2019, 3 years in:

https://youtu.be/Gv2I7qTux7g?si=p0kVhtB56GvVLLNr


D had compile time execution of functions in 2007.

Order-independent top level declarations.

Underscores embedded in integer literals. (I stole this idea from Ada, which had been forgotten. Soon after D popularized it, it became standard in other languages.)

Continue or break to labeled loop.

Fixed sizes for ints, longs, etc.

Of course, I don't know if there's a straight line here, and Zig is welcome to use any features from D that they like. But it's just interesting that things innovated in D pop up in subsequent designs.


> Underscores embedded in integer literals.

Perl had this years before D even existed [1]. Given its earlier age and higher reach, it's likely that Perl did more to popularize the idea as well.

> Continue or break to labeled loop.

Also a feature that Perl had years before D's existence [2].

These two are the ones I immediately recognized because of my familiarity with Perl, but given the trend, I'm doubtful of the other claims as well now.

[1] https://perldoc.perl.org/5.005/perldata [2] https://perldoc.perl.org/5.005/perlsyn#Loop-Control


I did not know Metaware and Perl did this, as I've never used either. I know that my inspiration for it came from Ada.

I accept that Metaware and Perl did this before D. But I still claim that adoption of it in other languages came shortly after I popularized it in D, as I included it in many presentations about it.


Metaware High-C version 1.2 (Nov 1985) had underscores in floating point and integer literals. Possibly it had that even earlier.

Possibly also taken from Ada, as other text in that section of the manual reference Ada.

See A.3 pg 169 (and 58+) of 235 in: https://bitsavers.org/pdf/metaware/High_C_Language_Reference...


I did not know that. Thanks for pointing it out.


mind, it is also possible that they took that from Algol 68, and 'adjusted it':

  $ a68g --strict -e '(INT a = 1 000; print((a,newline)) )'
        +1000
As Algol 68 allows spaces within numbers, as well as within identifiers.


> Order-independent top level declarations.

Javascript has had this for functions since 1995. This has been part of zig from the start, not added later.

> Fixed sizes for ints, longs, etc.

this has existed in stdint.h since C99. It doesn't take a genius, only years of pain with C/C++, to realize this is the better way to do things. And also, this was in zig from the start, not added later.

> Underscores embedded in integer literals

Also in zig from the start, not added later. Others have commented on the provenance.

I could be convinced that continue/break to labels was inspired by D.


>> Continue or break to labeled loop.

Hasn't Java had that since the beginning?

rummaging around in my grammar folder...

BreakStatement ::= "break" [ IDENTIFIER ] ';'

ContinueStatement ::= "continue" [ IDENTIFIER ] ';'


And so it does. I had forgotten. Thanks for the reminder!


Parsimony? more like thankful for learning from other language experiments and research work

Zig is young, and far from 1.0, and many long promised features still not implemented


> many long promised features still not implemented

name one that isn't async / sane recursion (which is also async)


or maybe even D




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: