Thread overview | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
November 19, 2006 OSNews article about C++09 degenerates into C++ vs. D discussion | ||||
---|---|---|---|---|
| ||||
http://www.osnews.com/comment.php?news_id=16526 |
November 19, 2006 Re: OSNews article about C++09 degenerates into C++ vs. D discussion | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mars | On Sun, 19 Nov 2006 12:25:03 -0800, Mars <nospam@null.void> wrote:
> http://www.osnews.com/comment.php?news_id=16526
Degenerates? :(
-JJR
|
November 19, 2006 Re: OSNews article about C++09 degenerates into C++ vs. D discussion | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mars | Mars wrote:
> http://www.osnews.com/comment.php?news_id=16526
One issue brought up is that of D "requiring" the use of a GC.
What would it take to prove that wrong by making a full blown standard lib that doesn't use a GC, and in fact doesn't have a GC?
It would be painful to work with but no more so than in C++. OTOH with scope() and such, it might be easy.
Anyway, just a thought.
|
November 19, 2006 Re: OSNews article about C++09 degenerates into C++ vs. D discussion | ||||
---|---|---|---|---|
| ||||
Posted in reply to BCS | On Sun, 19 Nov 2006 14:59:19 -0800, BCS <BCS@pathilink.com> wrote:
> Mars wrote:
>> http://www.osnews.com/comment.php?news_id=16526
>
>
> One issue brought up is that of D "requiring" the use of a GC.
> What would it take to prove that wrong by making a full blown standard lib that doesn't use a GC, and in fact doesn't have a GC?
>
> It would be painful to work with but no more so than in C++. OTOH with scope() and such, it might be easy.
>
> Anyway, just a thought.
Honestly, first we have to settle on a standard library, which I'm not so sure Phobos is at this point (now that would be a valid criticism from the outside). :P
As for a non-gc based library, it might be a useful experiment; but otherwise, I don't see the motivation for that (other than, I guess, for those very special cases); that said, I wouldn't mind seeing a minimalist one implemented, maybe based off of Ares?
Note, however, that C++ users, many who have grown dependent on manual memory management, are looking for a reason to fault D. I've actually heard cases where C++ users lambast GC based languages: use of a GC apparently creates "bad programming practices" -- imagine the laziness of not cleaning up after yourself!
People are locked in a whole way of thinking, and you can't really fight it unless they're willing to open up their perspective.
-JJR
|
November 19, 2006 Re: OSNews article about C++09 degenerates into C++ vs. D discussion | ||||
---|---|---|---|---|
| ||||
Posted in reply to BCS | > One issue brought up is that of D "requiring" the
> use of a GC. What would it take to prove that wrong
> by making a full blown standard lib that doesn't
> use a GC, and in fact doesn't have a GC?
>
> It would be painful to work with but no more so
> than in C++. OTOH with scope() and such, it might
> be easy.
It's not just a library issue, and in some ways I think it *would* be significantly more painful than in C++. D has a lot of innocuous-looking syntax that allocates heap memory non-obviously; AA and dynamic array initialization syntax, for instance. Without a GC, that's a lot of leaks and/or runtime errors waiting to happen.
I don't think it's an impossible sell, though. It would help to have a -nogc compiler switch or syntax attribute that disallowed usage of these constructs. And the scope stuff is coming on nicely; if Walter extends it to support RAII member data, as he's mentioned a few times, it'd be great.
The other big issue mentioned in the article comments is that D's GC implementation is lacking. It's hard to say whether a language with native pointers would really play nice with a copying collector, f'rinstance. Now that Java is GPL it'll be interesting to see whether the JVM's GC implementation can be yanked out for use by other languages: it's generational, copying and pretty well-tuned.
There's some other stuff that's been buzzing around in my head about thread-local heaps lately, but it's not coherent enough to constitute a suggestion yet.
|
November 19, 2006 Re: OSNews article about C++09 degenerates into C++ vs. D discussion | ||||
---|---|---|---|---|
| ||||
Posted in reply to BCS | BCS wrote:
> Mars wrote:
>
>> http://www.osnews.com/comment.php?news_id=16526
>
> One issue brought up is that of D "requiring" the use of a GC.
> What would it take to prove that wrong by making a full blown standard lib that doesn't use a GC, and in fact doesn't have a GC?
>
> It would be painful to work with but no more so than in C++. OTOH with scope() and such, it might be easy.
>
> Anyway, just a thought.
Having such a library would make a huge difference in every C++ vs D discussion! The opposition would have a lot less ammunition against us.
|
November 19, 2006 Re: OSNews article about C++09 degenerates into C++ vs. D discussion | ||||
---|---|---|---|---|
| ||||
Posted in reply to Georg Wrede | Georg Wrede wrote:
> Having such a library would make a huge difference
> in every C++ vs D discussion! The opposition would
> have a lot less ammunition against us.
Huh? When did this become an adversarial thing? If you're trying to convince someone that D is a better fit for their needs, labelling them "the opposition" probably isn't going to help.
Bear in mind that a lot of C++ programmers lived through the whole Java hypefest and tend to start twitching when told that GC will magically solve all their problems and they don't need to worry about it. There's a reason why Java's "simple" memory model sprouted PhantomReferences and SoftReferences and WeakReferences a few years down the line: resource lifetime management is a tricksy area with a lot of dark corners, and one size does not fit all. If D is successful it'll sprout similar accommodations in time, though hopefully cleaner ones. Until then, accept that D might not be the right answer for everyone just yet, and the discussion will be less combative and more constructive.
cheers
Mike
|
November 20, 2006 Re: OSNews article about C++09 degenerates into C++ vs. D discussion | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mike Capp | Mike Capp wrote:
> Georg Wrede wrote:
>
>> Having such a library would make a huge difference
>> in every C++ vs D discussion! The opposition would
>> have a lot less ammunition against us.
>
> Huh? When did this become an adversarial thing? If you're trying to convince
> someone that D is a better fit for their needs, labelling them "the opposition"
> probably isn't going to help.
>
> Bear in mind that a lot of C++ programmers lived through the whole Java hypefest
> and tend to start twitching when told that GC will magically solve all their
> problems and they don't need to worry about it. There's a reason why Java's
> "simple" memory model sprouted PhantomReferences and SoftReferences and
> WeakReferences a few years down the line: resource lifetime management is a
> tricksy area with a lot of dark corners, and one size does not fit all. If D is
> successful it'll sprout similar accommodations in time, though hopefully cleaner
> ones. Until then, accept that D might not be the right answer for everyone just
> yet, and the discussion will be less combative and more constructive.
>
> cheers
> Mike
Indeed. The people who really need to be GC-free are a tiny minority. Wasting a lot of manpower creating a non-GC library just people who don't want to convert from C++ will have one less justification for not using D sees like a huge waste of effort to me.
--bb
|
November 20, 2006 Re: OSNews article about C++09 degenerates into C++ vs. D discussion | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mike Capp | But those things *are* in Phobos.
One could, for example, throw an exception or generate an assert when they are used, at the very least, were they to be disallowed.
Or, those things could be garbage collected, and manual runs could be scheduled for any such. in any case, the rest of the library could have no gc usage.
It's really any time you get something for nothing, after all. It's not really that difficult to tell what uses memory, whether it has "new" in it or not - imho.
-[Unknown]
> It's not just a library issue, and in some ways I think it *would* be
> significantly more painful than in C++. D has a lot of innocuous-looking syntax
> that allocates heap memory non-obviously; AA and dynamic array initialization
> syntax, for instance. Without a GC, that's a lot of leaks and/or runtime errors
> waiting to happen.
|
November 20, 2006 Re: OSNews article about C++09 degenerates into C++ vs. D discussion | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mars | Mars wrote: > http://www.osnews.com/comment.php?news_id=16526 RE[2]: Not much of an update > By luzr (2.10) on 2006-11-19 19:44:17 UTC in reply to "RE: Not much of > an update" >>I second that. D is a very nice language with a clear focus. My first >>impression was that it has the best of Java, the best of C++ and none >>of they're major weaknesses. > >Adds one major weekness - its memory model is based on conservative GC, >which makes it unpredictable and in reality unusable for some important >applications (like cryptography or any other software that deals with >noise-like data). This is one thing that bothers me with the current GC. If you store data with a lot of entropy in an array (Sound, encrypted data, sensor data, etc...) you start to experience memory leaks because the GC starts to see the data as references to other objects. Is there a way to tell the garbage collector "don't look for references here" without using malloc and friends? This would be for a standard sliceable garbage collected array with any kind of data except references. Something like gc.doNotLookForReferences(myArray) would be nice. |
Copyright © 1999-2021 by the D Language Foundation