News for hackers. Stuff that matters.
Re:API changes in Snow Leopard by andreyf on Friday August 28, 2009 @05:32PM (#792327)
Mac OS X v10.6 provides support for block objects in C, C++, and Objective-C.

Huh? Isn't this a feature of a compiler, not an OS?

Re:API changes in Snow Leopard by 9oliYQjP on Friday August 28, 2009 @05:55PM (#792365)
I'm not sure why you got down voted to 0 for asking a legitimate question. The block objects are part of Grand Central Dispatch. A programmer tags an isolated unit of work as a block. The OS then takes these blocks and schedules them into execution queues. While the compiler adds support for defining the blocks themselves, OS X 10.6 provides purpose to these blocks. Just like you can have a VM which supports threads on an OS that itself is not multi-threaded, the feature would be pretty useless if only the compiler were updated as it has been for 10.6
Re:API changes in Snow Leopard by masklinn on Friday August 28, 2009 @06:42PM (#792434)
It also needs the instantiation support at the VM/runtime level, which is separate from the services the OS itself provides.

So blocks need to be supported at the compiler level, in the Objective-C runtime and in OS-wide processes (which would be Grand Central itself).

Re:API changes in Snow Leopard by pohl on Friday August 28, 2009 @06:04PM (#792382)
This is one reason why I like the old NeXT term "system software" in favor of "OS". (The former is all inclusive.)

Blocks are a language feature, and do need compiler support. The version of the compiler that you need to use them in GCD comes with v10.6 system software.

Re:API changes in Snow Leopard by antonovka on Friday August 28, 2009 @07:01PM (#792458)
It involves compiler and runtime changes, although they have been backported to the iPhone and 10.5:

http://code.google.com/p/plblocks/

Re:API changes in Snow Leopard by wmf on Friday August 28, 2009 @06:02PM (#792378)
OS X includes its own compilers.