Live data from Hacker News

D Language accepted for inclusion in GCC

gcc.gnu.org

31–40 of 235 posts

Re: D Language accepted for inclusion in GCC

#31
post #18

Earlier quoted context omitted.

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.

Rust has an opt-in garbage collector as a library (https://docs.rs/gc/). I don't know how good it is, though.

Re: D Language accepted for inclusion in GCC

#33
post #27

Earlier quoted context omitted.

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

"open source", no matter the capitalization, means what the OSI has defined. Unreal Engine is neither Open Source nor open source. It is simply proprietary. To say otherwise is a practice known as "open washing" that companies use to appear community friendly when in fact they are not.

Re: D Language accepted for inclusion in GCC

#34
post #28

Earlier quoted context omitted.

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?

Those > can be instantiated a finite number of times and then used like non-templated code.

So you have a C++ file that uses vector, vector, vector, vector, etc. once and then you can link to them from D code.

The only case where that doesn't work is when you have lots of one-off instantiations, where requiring an instantiation in C++ code for each use in D would get annoying quickly.

Re: D Language accepted for inclusion in GCC

#35

Earlier quoted context omitted.

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.

"open source", no matter the capitalization, means what the OSI has defined. Unreal Engine is neither Open Source nor open source. It is simply proprietary. To say otherwise is a practice known as "open washing" that companies use to appear community friendly when in fact they are not.

This. While OSI may not have been successful in getting an official trademark on the phrase "Open Source", in practice almost everybody treats "Open Source" or "open source" as meaning what the Open Source Definition states. Other "source available" approaches are more correctly termed "shared source" or something.

Re: D Language accepted for inclusion in GCC

#36

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?

I like Rust, but I hate with a passion the borrow system. So I was looking for an unsafe-by-default Rust and I found D, thanks to the suggestion of a kind HN user. I must admit that I love it!

Re: D Language accepted for inclusion in GCC

#38
post #21

Earlier quoted context omitted.

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# :)

> when stdlib will be more @nogc friendly

How does @nogc work in D? Is it easy to keep track of what needs freeing and what does not or is it easy to mix up and get hard bugs? Also, what do these bugs look like? Is use-after-free possible or how is the failure mode i that case? Is it possible to call free on an object after it's been garbage collected?

Re: D Language accepted for inclusion in GCC

#39
post #31
post #18

Earlier quoted context omitted.

D is garbage-collected, but can be opted out of. Rust has no garbage collector.

Rust has an opt-in garbage collector as a library ( https://docs.rs/gc/ ). I don't know how good it is, though.

By that measure, so do C and C++.

Re: D Language accepted for inclusion in GCC

#40

Earlier quoted context omitted.

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.

I don't see how dmd would be mergable with gcc, completely different backends. gdc however is a different story.
Post reply on HN