4 ms·
I keep thinking that the Next Big Language will be a thing of re-evolution, e.g. someone going back to C and retracing steps of C++ but in a more sensible way.
by huhtenberg 16y ago
I keep thinking that the Next Big Language will be a thing of re-evolution, e.g. someone going back to C and retracing steps of C++ but in a more sensible way.
Also, on a tangential note -- the garbage collection is a huge deal if an adoption of the NBL among C/++ programmers is considered. The only way is to have the garbage collection optional. Similarly to how D has it, but much much simpler. Something like adding new_gc operator (or a malloc_gc function) and to have two kinds of memory blocks - manually managed and garbage collected...
Anyway, it's just a thought from an old fart camp :)
- alexgartrell 16y agojust curious, do you allow malloc_gc'ed items to reference malloc'd ones?
- huhtenberg 16y agoSure. malloc'ed item could be the same as malloc_gc'd, but with its reference count artificially bumped up by 1. free() would decrement the count and the item will be picked up by the GC later on. If there's a provision for an immediate disposal of unreferenced items, then we are back to the standard malloc/free behaviour in case when malloc and malloc_gc items are not mixed.
- p0nce 16y agoReference counting is a bad C++ substitute for a real GC.
- huhtenberg 16y agoSure, absolutely. Just as C++ is a bad substitute for a real language. (edit) </sarcasm>
- brownleej 16y agoThat sounds like Objective-C. One of the reasons I first liked working with Objective-C (before the iPhone made it trendy) was that it seemed like a much better-executed version of what C++ was aiming to be. It has optional garbage collection now, but only on the Mac. Its type system is even close to what Steve described in this article.
- p0nce 16y agoThe D gc is not more a problem than C++ new is for real-time... RAII is possible and you can avoid allocations, also make custom allocators.