The GC itself isn't very good. The overall language performance, though, is quite good; the allocator isn't usually a bottleneck.
It is a worthwhile tradeoff for fully GC languages like Java. But it isn't worthwhile for D, which uses GC here and there and a lot of non-GC pointers and allocations. D trades things off in the other direction - faster runtime code generation, at the cost of a slower GC.
The more pointers you need to scan, the slower it becomes, and it'll stop all threads
It's fine for a compiler or a cli tool, but it's very bad for anything that runs forever and needs to scale (server and games, specially networked games where the world and number of entities is not fixed) you then need to think about managing your memory and working around the GC a lot; then you think about yourself, why use GC at all..
D needs invest more into non GC stuff and making the GC trully optional, make it possible to link the GC away if you don't need it, make the runtime less dependent on GC (ability to statically make GC usages assert such as 'new', rework associative array, and cleanup the runtime from requiring GC, thread, socket etc etc etc)
I use D everyday, i know how to deal with that kind of issue, but new people don't, and they might be turned off the day they need to workaround GC issues
Won't this depend on the programming style used? If the programmer makes heavy use of functional programming, or for that matter Java-style programming, wouldn't that result in a lot of object churn through the GC?
Personally, I make very heavy use of stack allocated objects, even for temporary buffers. Stack allocated objects cost nothing to allocate, nothing to free, and (being on the stack) are already in the hot memory cache.
I'm pretty sure the D guys figured it out, but i'm really curious to see what's the end result in the real world, once it reaches the dirty hands of end-product developers :))
But in most cases, most people will likely just need custom allocators, or just malloc. You can generate arbitrarily less garbage in D progressively.
Mixed allocation strategies is still nice because whatever is in GC memory doesn't need an owner (it has a global owner). Nowadays, the D GC is really unlikely to be a problem whatever your performance requirements. It isn't a problem for corporate users, as you can see on the parent link. Besides the GC performance increased in the last few years.
"Pluggable" GC-based arenas could make it work quite well. People routinely use ECS (entity-component systems) frameworks in GC-less languages like Rust that could mesh quite well with GC.
You do need some extra glue to harmonize the GC-based and GC-less paradigms (such as adding new "GC roots" for any GC'd objects that are being kept "alive" via links from non-GC ones, and demoting them when the references are dropped) but it's quite doable. Rust will probably get facilities for this once "local allocators" are added to the language in a reasonably stable form.
Lots of D code is fundamentally lazy.
For example, chain can be used to "concatenate" two arrays without allocating a byte.
But on the other hand, I write a lot of D code and often go back to that same story because it isn't terribly common anyway and easy to manage when you know how. Just yeah if you are mixing techniques without knowing the potential issue you can have trouble.
Of the issues the GC has, this isn't one of 'em.
Realistically programming languages take time to adopt culturally but they aren't that difficult
If you are a student we (D) regularly fund students to work on projects for us.
There's more money than you'd think in small communities - don't badger people, but don't be afraid to ask.
I wish they would at least check out my projects, and let me talk about them or something. I would probably work harder and better than some of their employees. I am currently working on a game and I do not sleep for 2-3 days. I am pretty dedicated when I am interested.
D, C++ (and also C# and Java) are very similar languages. If you learn any of those, learning the others will be easy.
C++ is just the most complicated because of the accidental complexity of the language.
C++ is much closer to something like OCaml than to C or Java.
The "complexity" is not accidental, and it only seems complex because people are not used to languages with static typing systems. C++ is not complex if you mastered something like the Haskell type system.
(C and Java aren't really statically typed; they rely on run-time typing for polymorphism.)
Dude, C++ can still compile C code, right? And how are C++ templates anything like Haskell or OCaml? Aren't they just some fancy text-based code generator thing, at the end of the day?
I'm really curious about this as everything I've seen so far contradicts your perspective.
Or are you talking just about modern C++ (post C++ 11)? That doesn't work as C++ of all kinds is out there in the wild and you'll run into it, at least from external dependencies.
C++ doesn't compete with Java or Go, C++ competes in the "polymorphism via static typing" niche along with Haskell, Ocaml, etc.
If you look at what Haskell at al. need to do to get static polymorphism right then C++ doesn't look at all that complex or strange.
> Dude, C++ can still compile C code, right?
No, wrong.
> And how are C++ templates anything like Haskell or OCaml?
C++ templates are a purely functional Lisp-like DSL.
> Aren't they just some fancy text-based code generator thing, at the end of the day?
So is Haskell.
> I'm really curious about this as everything I've seen so far contradicts your perspective.
You just don't know C++. People think they do because they learned a bit of C back in college, but they don't.
> Or are you talking just about modern C++ (post C++ 11)?
C++11 was a decade ago; hardly "modern".
> That doesn't work as C++ of all kinds is out there in the wild and you'll run into it, at least from external dependencies.
There's lots of legacy crap out there in the wild, including legacy COBOL and legacy Haskell. I fail to see your point; "modern" C++ isn't some wild departure from the original idea of C++. Ever since STL it has been in a pretty specific and well-defined trajectory.
Um, what? Having type information available at runtime is orthogonal to whether or not a language is statically typed.
D also makes generating code at compile time extremely easy which is a performance win at the expense of some compile time (no free lunch) but once again you slide the scale easily as the code the generates it is the same as at runtime.
There are two real backends one can use for these kinds of things, or one for Rust (LLVM) and friends.
Each has their strengths and weaknesses, and some users even switch back and forth depending on what they need at the moment.
I myself am not in the "move to ldc" camp, I like having dmd available for speed.
Oh not to mention it has C interoperability and a native cross-platform GUI library.
I like the idea of using D with a garbage collector and having something like GO, and then turning it off when I want to do something more performance oriented.
How is the performance of D compared to other garbage collected languages when the garbage collector is turned on?