3 ms·
I'm not sure what kind of "managed environment" you're talking about, but Go is not one. 1) You're right about GC pauses, but you certainly don't have more con
by dchest 14y ago
I'm not sure what kind of "managed environment" you're talking about, but Go is not one.
1) You're right about GC pauses, but you certainly don't have more control over the memory layout in idiomatic Objective-C than in Go. In ObjC you're mostly dealing with heap-allocated objects (by the way, remember that malloc is not deterministic too), and you don't have control over the objects' memory layout.
In the recent SDK, your typical NSNumber may be a tagged pointer or it may be a pointer to a number on heap -- you don't know, it's an implementation detail.
Hell, you don't even know the big O of NSArray! http://ridiculousfish.com/blog/posts/array.html http://ridiculousfish.com/blog/posts/array.html
Oh, and autoreleasing. Do you know how many objects will be released at the end of your NSAutoreleasePool? Nope -- you don't know how many were allocated by other people's code you called.
2) Again, I don't know what "manage environment" you're arguing against, but from Go you certainly can call C functions. But nobody does this for speed, only for compatibility with existing C libraries, if needed. You're programming in Go, not in two languages.
Go is not a 'managed language', whatever this Microsoft's term means, so I'm not even sure what to answer to your last paragraph.