4 ms·
You disable GC for the whole program? And what do you do when one of your dependencies relies on it? Just live with a memory leak? Bear in mind you're simply n
by dataflow 4y ago
You disable GC for the whole program? And what do you do when one of your dependencies relies on it? Just live with a memory leak?
Bear in mind you're simply not going to convince anti-GC folks that you can have the "good aspects" of a GC without the bad ones, and they're the folks you're trying to market to. To many C++ programmers the only good GC is one that is absent. You can tell them they're wrong all you want, but regardless of who's right, it's always been a losing battle.
- mhh__ 4y agoIt won't compile. You can also make it so it will compile but won't collect unless you ask it to explicitly. We don't exclusively market to C++ developers. D replaced PHP and Java for quite a few D users.
- dataflow 4y agoIt won't compile, and... how is that a solution? You've basically told some users they can't use your language in that case. That's problem solved? If you see PHP and Java replacement as taking off, that's awesome. I was addressing those who want to see it replace C++.
- mhh__ 4y agoThe express purpose of the @nogc attribute is to enforce that code under it's influence doesn't use the GC. There is lots of @nogc code available to depend upon
- dataflow 4y ago> There is lots of @nogc code available to depend upon That's not sufficient here. You can literally have a billion @nogc libraries, and even if there was one single GC-requiring library that many people want to use, the problem would be still there. The only way to make this work is to ensure all of the libraries most people want to use work fine without a GC (or have @nogc alternatives that people would actually want to use). While not theoretically impossible, practically speaking, that's incredibly hard to pull off when you have a shiny GC sitting there.
- dymk 4y agoIn practice, "lots" isn't good enough. The whole ecosystem should work, not just lots.
- mhh__ 4y agoIn practice (I.e. actual practice that pays my rent) it's been good enough for me
- dymk 4y agoThen why did D get lapped by Rust if @nogc is good enough and the ecosystem is good enough? If the answer is along the lines of "corporate backing", why did Rust get corporate backing and D didn't?
- mhh__ 4y agoRust did memory safety better than D did, which was a very attractive prospect and then Rust was also lucky enough to get a following of people who very noisy about it. Also in a world where JavaScript (excel, even) is dominant let's not ascribe these things to purely rational factors.
- gavinray 4y agoAye, you can turn off GC entirely, for the whole program There's even a mode of D that operates this way by default, "-betterC" meant to be a C replacement The GC really is an entirety opt-in component. I'd encourage you/other folks to give D an honest try, you might be surprised
- dataflow 4y agoYou're not understanding my point unfortunately. I never said you can't turn it off. I said if you do, and any of your dependencies expect it to be on, then you have a problem. (Yes, I have tried D. That's how I know this.)
- mhh__ 4y agoIf you actually turn it off (as in GC.disable()) they won't know either way, it's just a memory allocator to them.
- gavinray 4y agoOhhh, fair enough, yeah I see what you're saying. Yeah you're boned in that case I think and that's a real problem that can pop up if you want full @nogc EDIT: Maybe not based on Max's comment D-Plug (Audio FX plugins) is one example of having to build up a dependency stack of @nogc compatible deps, a lot of that is in-house stuff. Not impossible but it's a commitment, at which point you may as well use something else unless you REALLY want to use D, for sure.
- dataflow 4y ago> a lot of that is in-house stuff. That's exactly the issue. Having to reinvent every wheel you need just isn't a selling point.