5 ms·
I think the author means raw pointers to memory addresses, rather than pointers to variables/objects.
by occamrazor 11y ago
I think the author means raw pointers to memory addresses, rather than pointers to variables/objects.
- denim_chicken 11y agoEven then you can have a GC. It just has to be conservative and non-compacting. Even C/C++ have a GC via boehm-gc, a LIBRARY that implements garbage collection! (This is why I love C. No other practical language can claim to be able to implement a full-fledged GC as a library.)
- lomnakkus 11y ago> (This is why I love C. No other practical language can claim to be able to implement a full-fledged GC as a library.) Not to rain on anyone's parade, but I don't think many people think of a conservative & non-compacting GC as "fully fledged". (Don't get me wrong. It's probably useful, but y'know... let's call a spade a spade.)
- thinkpad20 11y agoI fat-fingered a down vote on this; just apologizing here. The perils of browsing HN comment threads on an iPhone...
- nickpsecurity 11y agoModula, Oberon, Ada... All have been used to implement GC's and OS's.
- umanwizard 11y agoWhat's the difference, in practice? Just the fact that you can do pointer arithmetic on the former?
- duaneb 11y agoGC is intractable with pointer arithmetic. Edit: to be clear, this is the classic difference between a reference (a value without arithmetic) vs a pointer.
- ori_b 11y agoThis isn't quite true, although you need some sort of guarantee on the arithmetic to ensure that each pointer is bounded within an object. C, in theory, allows this restriction, since computing a pointer to another object and dereferencing it is undefined behavior, but most implementations seem to relax this restriction.
- DonaldFisk 11y agoI think that Symbolics C did have this restriction.
- duaneb 11y ago> This isn't quite true, although you need some sort of guarantee on the arithmetic to ensure that each pointer is bounded within an object. I mean, this isn't pointer arithmetic, this is constrained offset lookup implementing a subset of pointer arithmetic (only addition of numbers >= 0?). I'd argue they're still not pointers unless you can derefence an arbitrary integer.
- ori_b 11y agoThen you're arguing that strictly conforming C code does not have pointers.
- duaneb 11y agoThe semantics of the english here is a little lacking, but I think strictly conforming C code has pointers that behave like references. To my current understanding, this is highly unrealistic, hence ameliorating tooling like address sanitization. To be clear, they would still be called pointers. But when people talk about the complications of pointers, they are referring to non-standard behavior which is necessary with today's C code (and pretty much all historic C code).