5 ms·
Isn't "automatic reference counting" just a specific type of "garbage collection"? But yes, I think this feature really slipped through the cracks in the annou
by themgt 15y ago
Isn't "automatic reference counting" just a specific type of "garbage collection"?
But yes, I think this feature really slipped through the cracks in the announcements I've seen so far (even Ars seemed confused about it)
- jcnnghm 15y agoI think this is done at compile time, so it wouldn't be considered garbage collection.
- themgt 15y agoThe compiler is LLVM though, "By enabling ARC with the new Apple LLVM compiler", which begins to blur the difference
- jcnnghm 15y agoI don't think that makes much difference, as long as it's performed at compile time.
- ori_b 15y agoLLVM is being used as a static compiler. There is no LLVM virtual machine - the compiler emits native machine code.
- themgt 15y agoMacRuby does support AOT compilation, although I don't think it's a very production-ready feature yet and would likely be incompatible with a fair percent of existing ruby code
- chc 15y agoThis isn't in MacRuby — it's in Objective-C. And it's explicitly distinct from garbage collection. This is an alternative to garbage collection that has generally been considered kind of impractical. (And MacRuby's AOT compilation works pretty well from what I've seen.)
- StrawberryFrog 15y agoit depends. If it copes with circular references, then yes, it is suffiecient to use for gc. If not then it's just what COM had.
- nupark2 15y agoUnfortunately, it doesn't handle cycles in the object graph[1], which was almost the entire reason I wanted GC. Manually dealing with cycles is one of the worst parts of working with blocks (the other is the lack of parameterized types). Assuming that ARC works reliably and consistently, it'll be nice to lose some boilerplate, but the worst facet of reference counting -- object graph cycles -- still isn't fixed. [1] There is support for zeroing weak references, but this is a very manual solution to the cycle problem.
- chrisjsmith 15y agoThat basically makes it useless. It would be an utter pain in the arse finding leaks in. I don't know why they cant chuck a generational collector in it such as the one in the last ObjC drop in it. Even microsoft with the woefully inadequate WM7 platform has a proper GC.
- nupark2 15y agoI wouldn't say useless -- just a lot less useful. Maybe they'll add cycle handling on top of it later.