C++ feature “lag,” native types on the GC Heap, a plug for some software I like


Garrett points out:



I *am* a tad sad that C++ tends to lag a generation behind C# on features in .NET.

I realize that's likely due to the larger effort required, with less resources than C#, and it seems that C++ is less ...sexy... than C#, but it's still sad . 🙁


Yes, it is true that C# is ahead of the game when it comes to new features - but you have to realize that we were at a disadvantage from the start.  The goals of our language redesign are very different from the goals of the C# team.  I tend to think they have it easy: their language is already made to target the CLR.  That's it, nothing more, nothing less.  We're trying to give our users the best of both worlds: native and managed.  All at once.  It's a difficult task, to say the least.  Having said that, it is unfortunate that C# is half a step ahead of us.  But they had a head-start - and we've closed the gap considerably.  I can only imagine that we'll be on-par (maybe a little ahead) by our next release.  (Psst... codename Orcas.)



How far off is that intent to put native types into the GC Heap?

I can see this as being a VERY handy feature, basically adding Garbage collection to native code. This will very quickly help cure some memory leaks and crappy code 🙂


I'm not certain I'm allowed to speak on this issue in specifics without violating some sort of NDA.  I can say, what you are looking almost certainly isn't coming in Whidbey.  But it is on the horizon. For sure.  We want it just as badly as you do.  I'd watch Herb Sutter's blog for more on that, he's come close to talking about it a couple of times.  In fact, he's already said the following:



In my previous blog entry, I listed two reasons not to conflate the type category with where objects of that type can be allocated, namely to let us in the future support allocating native types on the GC heap, and CLI types on the native heap. The decision to garbage-collect or not should not be per-type (as it was in MC++), but per-object.


By the way, if you're trying to keep track of multiple blogs, I highly suggest Newsgator.  It aggregates blogs (using their RSS feeds) and dumps it into Outlook for you.  Convenient!

Comments (0)

Skip to main content