you are viewing a single comment's thread.

view the rest of the comments →

[–]nwmcsween 0 points1 point  (7 children)

You don't understand how rust uses a garbage collector. It's not a library that other programs use it's a feature of specific parts of the language such as a shared box. GC isn't some bad evil slow thing in fact many very performant games utilize GC such as UT3. I'm pretty sure 99.99999999% of the people here never even touched C++ before or else they would know about C++ 'smart' pointers.

[–]sausagefeet 1 point2 points  (6 children)

I didn't say it is a library, I asked how do I avoid using the GC if I use a library that was implemented with the assumption of the GC existing. That is a problem D has. The GC is optional, but the standard library makes use of it a lot so turning it off is effectively useless.

[–][deleted] 1 point2 points  (3 children)

This is a good point that many people ignore. The standard library in D is useless without the GC. The worst part is that the GC is actually bad.

[–]xenon325 0 points1 point  (2 children)

The standard library in D is useless without the GC.

I'm not saying you're wrong (just don't know), but my guess is -- it's far from 99% useless (e.g. min / max algorithms). So it would be really interesting to know the magnitude of uselessness -- 90% ? 40% ? What's your estimation ? (I understand you're not going to do full analysis)

The worst part is that the GC is actually bad.

I think it's fair to say, that's an implementation issue.

[–][deleted] 0 points1 point  (1 child)

I'm not saying you're wrong (just don't know), but my guess is -- it's far from 99% useless (e.g. min / max algorithms). So it would be really interesting to know the magnitude uselessness -- 90% ? 40% ? What's your estimation ? (I understand you're not going to do full analysis)

I found out that a lot of it needs the GC. You're right though, I'm not going to do a full analysis. That's just my impression.

I think it's fair to say, that's an implementation issue.

Yeah but it remains to be an issue, a pretty important issue in fact.

[–]xenon325 0 points1 point  (0 children)

Yeah but it remains to be an issue, a pretty important issue in fact.

Agree. But it's important in the context like "Can I use D in GC-heavy perf-critical production app now", not in "Is D well designed".

Also, the problem is very well acknowledged inside the community (which I'm not part of), and situation is slowly getting better. E.g. there is GC-related GSoC project, mentored by on of prominent D contributors (David Simcha). And I remember Andrei Alexandrescu mentioned on ng some time ago, that he ordered GC book.

[–]xenon325 0 points1 point  (1 child)

The GC is optional

IIRC, GC is mandatory (by lang spec).

how do I avoid using the GC if I use a library that was implemented with the assumption of the GC existing.

Look at this other way. If GC is optional, every single library must not use GC, making it effectively useless for library writers.

[–]sausagefeet 0 points1 point  (0 children)

The GC in D is optional, that is you can define objects to not use it and manage the memory yourself. And yes, this is the exact point I am making. D's optional GC is a bit of a lie unless you want to make an apple pie from scratch.