4 ms·
Imho, D's choice to be garbage collected has prevented wider adoption (that's the case for my usage at least). And as a compiled gc language, it competes square
by elromulous 6y ago
Imho, D's choice to be garbage collected has prevented wider adoption (that's the case for my usage at least). And as a compiled gc language, it competes squarely with golang, something that's likely hard to do, given the corporate (google) support golang has.
Side note: I met the creater of D, Walter Bright (also of course famous for the digital mars compiler) at going native 2013 (now known as cppcon). Bright was the nicest guy, and was happy to field my questions. We even chatted about rust, which was just a twinkle at the time!
- nerdponx 6y agoInterestingly, Crystal and Nim also seem to be getting more press than D. And Crystal is more of a direct Go competitor than D is.
- banachtarski 6y agoAs just one anecdote, the mere presence of a GC made me stop looking at D more or less immediately. In terms of positioning, I think D would be better served focusing on a vertical.
- mhh__ 6y ago> I think D would be better served focusing on a vertical. I don't know what that means
- bachmeier 6y ago> As just one anecdote, the mere presence of a GC made me stop looking at D more or less immediately. A lot of people say that, but that's the tip of an iceberg of 500 items that will prevent someone that doesn't want GC from using it. In other words, nobody ever used a language only because it didn't have a GC.
- Kranar 6y agoIf you're being absolutely extreme then sure that's true. I'd still use Ruby with it's garbage collector to implement a video game instead of using Brainfuck even though Brainfuck doesn't have a GC. But if we're being reasonable, then I can say me and my company mostly still use C++ because it doesn't have a GC. It's an otherwise horrible language and I'd love to get off it. For a new project making an order matching system for a financial exchange, we are experimenting with Rust as an alternative and it's looking very promising. I want to see a bit more how the async situation plays out because that aspect of the language has me concerned but overall it's a really clean and principled language. At any rate, the point is that a GC in and of itself is a major deciding factor about whether a language is used or not for many production grade systems.
- bachmeier 6y ago> If you're being absolutely extreme then sure that's true. I wasn't being extreme. I was making a statement based on year after year seeing people make the same claim. After the GC is gone, then it's the legacy C++ code, the lack of documentation, the lack of developers experienced with C++, the tooling, various language issues, and on and on. The thing is, you can already disable the GC and slap @nogc on your program and you don't have a GC. Or compile with the -betterC flag and you don't have a GC. It's not like D requires using the GC. When you say that, the reply is "Yes, but..." followed by issues using D as @nogc. > we are experimenting with Rust as an alternative and it's looking very promising. I want to see a bit more how the async situation plays out because that aspect of the language has me concerned but overall it's a really clean and principled language. This is exactly what I'm talking about. The GC is only one of many reasons you're not using D and probably never will. And that's okay, because if you remove the GC, someone like me will never look twice at the language.
- Kranar 6y agoIf you had said "No one ever decided not to use D because of the GC" or something along those lines sure... I'd agree. But your claim was "No one ever decided to use any language whatsoever because it didn't have a GC." and that's simply untrue. If C++ got a GC I would immediately stop using it and would have never used it to begin with. All the rest of your points in your follow up post are very specific to D and yes, those other points are all legitimate reasons people don't use D, regardless of its GC. It's simply that your original claim about language preference on the basis of GC was not specific to D and it's certainly false.
- bachmeier 6y ago> But your claim was "No one ever decided to use any language whatsoever because it didn't have a GC." and that's simply untrue. If C++ got a GC I would immediately stop using it and would have never used it to begin with. There are some English issues with your post (using a language because it doesn't have a GC is pretty different from quitting a language because it has a GC) so I'm going to let this discussion die.
- WalterBright 6y agoYou could use D in BetterC mode, and there won't be a GC.
- EvenThisAcronym 6y ago> As just one anecdote, the mere presence of a GC made me stop looking at D more or less immediately. That's a shame, because it is extremely easy to write GC-free code in D. One very important fact is that if you don't allocate using the GC (using "new", appending to a slice, etc.), *the GC will never run*. D provides you a ton of tools to make sure that you're not doing GC allocations, and if you are, where in your code they are happening (@nogc, -vgc and even -betterC).
- mhh__ 6y agoWalter is on here too > digital mars compiler And the one/s before that, even. He wrote the first proper C++ compiler to my knowledge, and lots of that shows in D.
- generichuman 6y agoThey're replacing a lot of GC'd standard library functions with @nogc functions, so people might not have to depend on the GC soon. Some people were also working on a reference counted type (that'd replace the GC I guess?) a few years ago, but I don't know what happened to that, or if it did make into the language. There are a few open RC pull requests from 2019 on the d runtime repository.
- diegocg 6y agoWalter has plans to add ownership and borrowing to D https://dlang.org/blog/2019/07/15/ownership-and-borrowing-in-d/ https://dlang.org/blog/2019/07/15/ownership-and-borrowing-in... Not sure what the current state is.
- WalterBright 6y agoI'll be talking about it at the April nwcpp.com virtual meeting. All are welcome.
- vips7L 6y agoHere is a library for smart pointers: https://github.com/atilaneves/automem https://github.com/atilaneves/automem
- petre 6y agoI like the GC so I don't have to bother with manual memory management. It also a simpler GC which works quite predictably and one could work with it or around it. I hope it stays in the language. One could use @nogc if they don't want it. D's GC is also configurable: https://dlang.org/spec/garbage.html https://dlang.org/spec/garbage.html