Live data from Hacker News

D Language accepted for inclusion in GCC

gcc.gnu.org

11–20 of 235 posts

Re: D Language accepted for inclusion in GCC

#11
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.

>> I wonder what has changed that they're letting it in to the official repository.

Because they need an alternative to the mess that is C++ and Rust is already married to LLVM.

Re: D Language accepted for inclusion in GCC

#13
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 reference compiler got open sourced about 2 months ago. https://news.ycombinator.com/item?id=14060846

How does this work exactly from a licensing perspective? Will they merge the dmd sources into the gcc tree? Does this mean that the D compiler in gcc will now be GPL(v?) licensed? This is certainly possible since dmd is licensed permissively.

https://github.com/dlang/dmd/blob/master/LICENSE.txt

I don't mean this to start a fight over licenses I'm just curious how it works when gcc lets other projects in.

Re: D Language accepted for inclusion in GCC

#15

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.

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.

Re: D Language accepted for inclusion in GCC

#16
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 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 Iain and helpers did the grunt work consistently for years now.

Re: D Language accepted for inclusion in GCC

#17
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.

I assume the idea is to be able to reuse libraries like Box2d etc where it's mostly concrete code, and that other libraries where it's mostly templates kind of just have to be rewritten.

Re: D Language accepted for inclusion in GCC

#18

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 garbage-collected, but can be opted out of. Rust has no garbage collector.

Re: D Language accepted for inclusion in GCC

#19

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?

They are very different languages. Rust was designed to be GC-free and memory safe. D, on the other hand, has GC and is memory unsafe by default.
Post reply on HN