Live data from Hacker News

D Language accepted for inclusion in GCC

gcc.gnu.org

111–120 of 235 posts

Re: D Language accepted for inclusion in GCC

#111
post #57

Silly me, I was under the impression that gdc was already part of gcc... Well, so at least now I am no longer mistaken. ;-) I have tried to learn D repeatedly over the last couple of years, but I was usually scared off by how complex this language is. Even so, the syntax is far cleaner than C++[1]. Also, the last time I gave it a try, something finally clicked. I am not all there yet, but I am beginning to like it. T…

I was pleased to see that C++ finally gave up on trigraphs.

Re: D Language accepted for inclusion in GCC

#113
post #80

Earlier quoted context omitted.

Just more pragmatic, I'd say. D isn't a "big agenda language" (to steal a line from Jonathan Blow). It's extremely multi-paradigm (some might argue to a fault). I think that's why you find people saying D is like C++ or D is like C# or D is like Go or D is like Rust. You get a little taste of everything using D. Want function programming and purity? Check. Want C style/low abstraction code? Check. Want extreme C++ me…

> think that's why you find people saying D is like C++ or D is like C# or D is like Go or D is like Rust. You get a little taste of everything using D. That's a major problem, and not a feature. One of C++'s main drawbacks is its size and arcane features, to the point that the language is known for being impossible to master. If all D brings to the table is an agenda to pick off C++'s complexity and drive it up even…

But it didn't drive up the complexity. It drastically simplified how a lot of features work. C++ is very difficult to master not because of the number of features in the language (it really isn't even all that featureful compared to other modern languages) but because of the thousands of unexpected details you have to know. Scott Meyers made a career out explaining them (and implored D not to make the same mistake of needing someone like him). That doesn't mean the overarching feature can't be implemented in a simple way that avoids the unintended complexity though. Anybody you ask with knowledge of both D and C++ would say that D's metaprogramming facilities are both drastically easier and more powerful than what C++ offers, for instance. It's actually shocking how much you need to know to fully understand things like template/regular type deduction (which aren't the same), initialization, rvalue behavior, forwarding references (or is it universal references...they came up with the feature before they gave it a name), what is constexper-able, reference collapsing, etc. These things are all straightforward in D because they were either designed without the edge cases and legacy behavior or left out entirely because the problem was tackled in a different, more simple way at a fundamental level.

Re: D Language accepted for inclusion in GCC

#114
post #65

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.

The first time I said that on HN somewhere else I got quite a flak. I don't know when OSI's definition became mainstream. The first time I heard open source, it meant the same as what you said. Nowadays you have to use a different term for that. Collins still has the old definition "free to use or modify". Merriam-Webster and Oxford has since included "redistribution" in the definition. The term "shared source" is no…

> I don't know when OSI's definition became mainstream. The first time I heard open source, it meant the same as what you said. Nowadays you have to use a different term for that.

The notion that the phrase "open source" started out with broader definition but was later revised by OSI is itself revisionism.

OSI's definition is important because the phrase "open source" originates with the folks behind OSI—the term did not exist before 1998 when they created it. The phrase resulted from a public awareness effort leading up to the release of the Mozilla code on March 31, because the only alternative that had legs at the time was the FSF's term "free software", which had marketability problems. A few months later, a bunch of those involved in the brainstorming session where "open source" was coined went on to start the OSI as an advocacy group primarily concerned with:

a) marketing the term "open source" to get the public to adopt it en masse

b) advocating for the adoption of open source ideals themselves

To sum up, there has never been a time when "open source" meant something besides how the OSI defined it, except for sloppy usage in instances of someone co-opting the OSI's term but not their definition for it.

(Disagree with whether it's a good definition or not, but telling history and facts wrong is something to be avoided.)

Re: D Language accepted for inclusion in GCC

#115
post #19

Earlier quoted context omitted.

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.

If you add:

    @safe:
at the top of your code, it'll be memory safe (excluding issues which we plug 'em when we find 'em). I wouldn't say that makes it fundamentally different from Rust. What is fundamentally different from Rust is the approach D uses to implement memory safety.

Re: D Language accepted for inclusion in GCC

#116
post #19

Earlier quoted context omitted.

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.

Call me wrong if I misunderstood, but isn't reference counting also kind of GC?

Yes, RC is a form of GC.

Re: D Language accepted for inclusion in GCC

#117

Earlier quoted context omitted.

Call me wrong if I misunderstood, but isn't reference counting also kind of GC?

Rust doesn't use reference counting (until you want to use it)

Isn't borrow-checking a sort of compile-time reference counting? Not what people usually think of when they say "reference counting", but I wonder if it's a good way to think of borrow-checking.

Re: D Language accepted for inclusion in GCC

#118
post #65

Earlier quoted context omitted.

The first time I said that on HN somewhere else I got quite a flak. I don't know when OSI's definition became mainstream. The first time I heard open source, it meant the same as what you said. Nowadays you have to use a different term for that. Collins still has the old definition "free to use or modify". Merriam-Webster and Oxford has since included "redistribution" in the definition. The term "shared source" is no…

> I don't know when OSI's definition became mainstream. The first time I heard open source, it meant the same as what you said. Nowadays you have to use a different term for that. The notion that the phrase "open source" started out with broader definition but was later revised by OSI is itself revisionism. OSI's definition is important because the phrase "open source" originates with the folks behind OSI—the term di…

I wrote a blog post about that:

http://jordi.inversethought.com/blog/5-things-we-have-forgot...

Re: D Language accepted for inclusion in GCC

#119
post #90
post #74

This is basically the work of one tireless man; Iain Buclaw. Many thanks to him for putting in so much time and energy into this. It took 6 years from first submission to get it in. Here are the slides from his 2017 DConf talk about the work that went into making this happen: http://dconf.org/2017/talks/buclaw.pdf

Slowly but steadily. Given the fact that D has not managed to die when it had so many chances to, I tell that D has better chance at mass adoption as "a better C++" than the current wave of Swift/Rust/Go that rely on "life support" from a corporate donor.

I don't think it's meaningful to put Swift, Rust and Go in a single bucket when comparing them. They're languages targeting different levels of abstraction, with very different approaches as a result.

Some people refer to all of these as "better C++", but it's meant in very different and incomparable ways. For example, Rust is ostensibly a "better C++" in a sense that it retains the low-level, zero-overhead (no GC) etc nature and powerful metaprogramming facilities. Go is a ostensibly a "better C++" because it promotes higher-level, safer abstractions that are still "fast enough" (but not zero-overhead). Ditto Swift.

D is arguably in the same bucket as Swift, and partly as Go. I don't think it's very useful to compare and contrast it against Rust. And I think that of all of these, Rust is the only one that can truly claim to be a "better C++" in a meaningful way. Others are "something better than C++ for most apps you'd write in C++ today".

Re: D Language accepted for inclusion in GCC

#120

Earlier quoted context omitted.

Rust doesn't use reference counting (until you want to use it)

Isn't borrow-checking a sort of compile-time reference counting? Not what people usually think of when they say "reference counting", but I wonder if it's a good way to think of borrow-checking.

Some people make this analogy, but it has so many caveats, and is so far away from what people think about as RC, and has very serious and significant differences, that I don't think it's a useful analogy, personally. I even might go so far as to say "actively harmful." Not totally sure though.
Post reply on HN