Re:Digital Mars C / D compiler
Posted: Thu Feb 02, 2006 9:52 am
Of course they are. But I will always keep a stick handy to poke 'em or beat the crap out of 'em. I don't like it when a runtime does strange stuff "automatically", especially not when it's a production server I have to maintain.Colonel Kernel wrote: I think you'll have to lose some of your distrust of GC's, because IMO they're here to stay.
Can't really comment.GC also makes many lock-free algorithms a lot easier to implement...
Huh? How so? I'd be interested in this bit of information....and it makes memory management much more scalable on multiprocessor systems (allocation is much faster...
Which sometimes is not what you want - for example, when you're caching your memory yourself because what the language gives you by default eats too much performance. (Consider paperweight patterns and custom allocators working on preallocated memory in C++.)...deallocation can happen asynchronously.
Funny enough, I have almost never used new / delete in years of C++ development. To the contrary, I found it to be somewhat of a warning pointing to bad use of the language. But I've seen destructors that close transactions, files, connections - and perhaps even more importantly, printing debug information about the lifetime of an object...Take a step back and ask yourself: Why do we need destructors?
Because they were used to the malloc'ish ways of C. In my experience, transition from C to C++ sharply reduced the number of pointers in a program. Partially replaced by references, partially replaced by clever class layouts.10 or 15 years ago, the answer most people would give is "to free memory"...
Full ACK on the first, partial ACK on the latter. I like to have the option to do something. (Which makes me loathe Java all the more.)The truth is, we will always need deterministic destruction, but IMO for non-memory resources only.
Options are A Good Thing (tm), as long as there's One Obvious Way To Do It (tm). (Yes, I also loathe Perl. )The best approach I've seen is in the upcoming C++/CLI extensions. You can still write destructors that get called deterministically for so-called "unmanaged resources", but you also have the GC to free memory. I think this is a pretty good balance.
Some here are writing their OS in Pascal, an endeavour that makes my hairs stand on end.I know next to nothing about D, but MS Research wrote a kernel in a variant of C#, so IMO anything is possible...