Live data from Hacker News

D Language accepted for inclusion in GCC

gcc.gnu.org

181–190 of 235 posts

Re: D Language accepted for inclusion in GCC

#181

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?

From what I've read (and I may be off), but to me it does not seem that D provides many of the features that make Rust useful: algebraic data types, typeclasses, memory safety without a managed runtime.

Re: D Language accepted for inclusion in GCC

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

Well Java relies on "life support" from Oracle (and previously Sun) and it has definitely achieved mass adoption.

Re: D Language accepted for inclusion in GCC

#183

Earlier quoted context omitted.

How is D's memory safety without the GC? How does it guarantee you don't use-after-free, de-ref nulls, buffer overflow, etc?

Great question! The answer is a bit more than a simple reply can do, so: Pointers Gone Wild: Memory Safety and D http://dconf.org/2017/talks/bright.html

It seems like use-after-free is still a potential issue, even with those guard rails. Rust deals with those through named lifetimes --would those ideas be useful in D as well?

Re: D Language accepted for inclusion in GCC

#184
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?

One of the biggest differences in practice between reference counting and GC (or "other forms of GC" if you consider RC a type of GC) is that nodes involved in a cycle will never be freed.

Re: D Language accepted for inclusion in GCC

#185
post #165

Is there a D IDE with good code completion and refactoring support? Last time I tried it, all that I've seen were pretty bad at it - handling the simple stuff fine, but breaking down on more complicated stuff, metaprogramming especially (kinda like most C++ IDEs did 8 years ago or so).

Code completion yes. (DCD provides this as a library). d-mode for emacs is nice, both of the plugins for vs-code I know work. There are plugins/extensions for (i think) xcode and (i know) Jetbrains's stuff (I don't use it so i can't really comment. Refactoring, no. Edit: There is also a D-specific IDE called coedit, which is pretty good AFAIK

I just checked out Coedit. It looks quite nice, although I'm rather baffled that it's written in Pascal.

I assume it's forked from an existing open-source editor, but there's nothing in the source headers to say which one.

Re: D Language accepted for inclusion in GCC

#186

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.

Not really, it doesn't count references in the same way. The borrow checker maintains a set of rules that are more expansive than reference counting. For instance the rule that you may only have one &mut at a time, and no other references as long as &mut is alive. It also has something like linear types with ownership rules, where owned values can be used only once.

Re: D Language accepted for inclusion in GCC

#187

Earlier quoted context omitted.

It's a big world out there. Would you ever imagine that D would be taking market share from... Extended Pascal? But there's a naval architect who designs great big ships with a 500k sloc codebase he is exploring porting to D. Web guys get the attention but enterprise users are a much bigger world than just that. If something is growing very quickly then saying it hasn't yet dethroned C, so it won't ever be significan…

I did not compare D to C, but rather to Rust, Swift, and Go. Compared to D, Go already has huge marketshare. Rust, similarly, excels in spaces that D does not endeavor to work in (no-managed-runtime settings), and is beginning to see adoption in areas where performance is critical. From what I have seen of D, it provides a C++ without some of the cruft, but without trying to solve other issues with C++-like languages…

Over Go: D has meta programming, exceptions, and many more useful features

Over Rust: No need to learn new concepts like borrowing

Re: D Language accepted for inclusion in GCC

#188
post #165

Earlier quoted context omitted.

Code completion yes. (DCD provides this as a library). d-mode for emacs is nice, both of the plugins for vs-code I know work. There are plugins/extensions for (i think) xcode and (i know) Jetbrains's stuff (I don't use it so i can't really comment. Refactoring, no. Edit: There is also a D-specific IDE called coedit, which is pretty good AFAIK

I just checked out Coedit. It looks quite nice, although I'm rather baffled that it's written in Pascal. I assume it's forked from an existing open-source editor, but there's nothing in the source headers to say which one.

I think it's based on Lazarus.

Re: D Language accepted for inclusion in GCC

#189
it seemed like facebook was interested in d for a while, but then it also seems they dropped it in favour of ocaml

i think so, because i believe ocaml and d do compete, and it is clear facebook stopped using d and now used ocaml in several project, they even created reason

any idea why facebook dropped d

Post reply on HN