News for hackers. Stuff that matters.
Re:In praise of Go or "Why I moved from Python and C++ to Go" by dadkins on Wednesday November 17, 2010 @02:09AM (#1913257)
x = new(foo) ... x = nil

There. Manual memory management. What? It's not as if when you free() something that was malloc()'ed, it gets returned to the operating system right away. It just goes back on the free list. Garbage collection amortizes that.

Re:In praise of Go or "Why I moved from Python and C++ to Go" by andolanra on Wednesday November 17, 2010 @02:42AM (#1913330)
Well, by the same token, you can take Python's

    x = Foo()
    ...
    del x
as manual memory management, after a fashion (which it is). The kind of manual memory management I'm concerned about is less about having precise control over when memory passes in and out of my program's control, and more about controlling fragmentation and time spent searching for unused memory. For example, would slab allocation--an extremely useful technique for operating systems, databases, &c--be possible in Go?

Addendum: I'm not trying to denigrate Go, and I don't mean to suggest having or not having fine control over memory makes or breaks a programming language, because it's a valuable tool in certain instances and a hindrance in others. I honestly don't know whether or not it's possible in Go; I suspect it is, to some extent, although it would no doubt be discouraged by the design of the language.

Re:In praise of Go or "Why I moved from Python and C++ to Go" by jpr on Wednesday November 17, 2010 @06:17AM (#1913844)
"What", exactly. If Go really deleted the object pointed to by x when you set x to nil, it would be seriously flawed (though I wouldn't actually be surprised if this was the case, it certainly is flawed in many other ways).