Live data from Hacker News

D Language accepted for inclusion in GCC

gcc.gnu.org

21–30 of 235 posts

Re: D Language accepted for inclusion in GCC

#21

I have read many posts saying D was better than C++ as a language but there were no libraries for use case X. Now this may help popularise the language.

D seems like a more useful Rust, or is that completely wrong?

In my experience, D is like more powerful and feature-packed C#. It doesnt impose any limitations on you and your coding style/paradigm and strives to be "the one to rule them all" tool which has everything and can be used for everything from scripting to systems programming (when stdlib will be more @nogc friendly).

And yes, templates are so much better in D than in C++ or in C# :)

Re: D Language accepted for inclusion in GCC

#22

I have read many posts saying D was better than C++ as a language but there were no libraries for use case X. Now this may help popularise the language.

D seems like a more useful Rust, or is that completely wrong?

IIRC Rust and D have different targets for use. Rust is for safe systems programming so that you don't get UB in C, while D is better C++. Also Rust new compared to D.

Re: D Language accepted for inclusion in GCC

#23
post #2

There has been out-of-tree GCC support for D for several years. I wonder what has changed that they're letting it in to the official repository.

The out of tree codebase - was extensively updated with development being led by Ian Buclaw. Ian has given some presentations on all the changes and updates at the recent D language conference - Dconf 2017. see https://www.youtube.com/watch?v=g-5T4zlc_bc

Re: D Language accepted for inclusion in GCC

#24
post #15

Earlier quoted context omitted.

One of D's goals is to be ABI compatible with C and C++, ABI compatibility with C is 100% as I understand it. C++ is a work in progress. What is ABI compatiblity? in a nutshell it let's you use libraries from another programming language. In D, all you need is a D file that describes the C/C++ library as a wrapper so the D compiler knows what you are using. This means D will build upon everything that already exists…

How would that even work? Modern C++ libraries are largely templates, templates which must be instantiated at compile-time i.e. you need a full C++ compiler to use C++ libraries directly. Said compiler must somehow work together with the D compiler here, which should lead to god-awful memory use, compilation time, and error messages.

https://dlang.org/spec/cpp_interface.html

Re: D Language accepted for inclusion in GCC

#25

I have read many posts saying D was better than C++ as a language but there were no libraries for use case X. Now this may help popularise the language.

D seems like a more useful Rust, or is that completely wrong?

D is like Go if Go had actually been a "systems" programming language. Rust is difficult to compare to other stuff.

Re: D Language accepted for inclusion in GCC

#26
post #14
post #5

Does this mean D-via-GCC will be supported on more platforms going forward than what is supported today?

Someone still needs to provide the man power for porting and maintaining those platforms.

Yes, understood. What I don't know is how much D-specific work is needed in the gcc backend per-target-triple.

If it's a small amount of work, and the only thing really preventing it is wider adoption, this news may be the kick that it needs.

If it's a large amount of work, then this news likely won't change much.

Re: D Language accepted for inclusion in GCC

#27
post #16

Earlier quoted context omitted.

The reference compiler got open sourced about 2 months ago. https://news.ycombinator.com/item?id=14060846

The reference compiler is unrelated. The frontend has been Free Software since the beginning. The reference backend was only Open Source (not freely redistributable). So, alternative backends were plugged to the frontend, LLVM and GCC. They all share the same frontend still, although LLVM and GCC slightly lag behind the reference in version (LLVM is nearly in sync). This announcement is official recognition after Iai…

> The reference backend was only Open Source (not freely redistributable).

Free redistributibility is part of the Open Source Definition. It is literally the first item: https://opensource.org/osd-annotated

Re: D Language accepted for inclusion in GCC

#28
post #15

Earlier quoted context omitted.

One of D's goals is to be ABI compatible with C and C++, ABI compatibility with C is 100% as I understand it. C++ is a work in progress. What is ABI compatiblity? in a nutshell it let's you use libraries from another programming language. In D, all you need is a D file that describes the C/C++ library as a wrapper so the D compiler knows what you are using. This means D will build upon everything that already exists…

How would that even work? Modern C++ libraries are largely templates, templates which must be instantiated at compile-time i.e. you need a full C++ compiler to use C++ libraries directly. Said compiler must somehow work together with the D compiler here, which should lead to god-awful memory use, compilation time, and error messages.

Most useful C++ code is either not templates or it's templates which can be instantiated a finite number of times and then used like non-templated code. Most "header-only"/header-heavy C++ libraries which present the problem you mention solve problems like C++'s smart for loop working like "for x in xs" does in Python but not working like "for x,y in zip(xs,ys)" does or like "for i,x for enumerate(xs)" does etc.; you don't really need these outside C++ (whether you need them inside C++ is another question but it's irrelevant here.)

Re: D Language accepted for inclusion in GCC

#29
post #27
post #16

Earlier quoted context omitted.

The reference compiler is unrelated. The frontend has been Free Software since the beginning. The reference backend was only Open Source (not freely redistributable). So, alternative backends were plugged to the frontend, LLVM and GCC. They all share the same frontend still, although LLVM and GCC slightly lag behind the reference in version (LLVM is nearly in sync). This announcement is official recognition after Iai…

> The reference backend was only Open Source (not freely redistributable). Free redistributibility is part of the Open Source Definition. It is literally the first item: https://opensource.org/osd-annotated

I think they meant lower case "open source" (as in the source is open (anyone can read/compile it)). There are plenty of software that are open source but not freely distributable, such as Unreal Engine.

Re: D Language accepted for inclusion in GCC

#30
post #28
post #15

Earlier quoted context omitted.

How would that even work? Modern C++ libraries are largely templates, templates which must be instantiated at compile-time i.e. you need a full C++ compiler to use C++ libraries directly. Said compiler must somehow work together with the D compiler here, which should lead to god-awful memory use, compilation time, and error messages.

Most useful C++ code is either not templates or it's templates which can be instantiated a finite number of times and then used like non-templated code. Most "header-only"/header-heavy C++ libraries which present the problem you mention solve problems like C++'s smart for loop working like "for x in xs" does in Python but not working like "for x,y in zip(xs,ys)" does or like "for i,x for enumerate(xs)" does etc.; you…

That sounds ..wrong. what about the C++ standard library? Neither vector or sort sounds like that?
Post reply on HN