News for hackers. Stuff that matters.
Re:Node.js is Backwards by SeoxyS on Monday June 13, 2011 @07:32PM (#2651162)
Speaking of concurrent programming and parallelism. If you're not into functional programming, check out Apple's Grand Central Dispatch[1] and Objective-C Blocks[2].

Unless you write your own Objective-C http server and run it on Mac OS X Server (it's not that hard, I've done it), this isn't very useful for Web programming. However, if you're comparing the languages / frameworks themselves (you can use all three to code command line tools, for example), GCD becomes a very seductive option.

GCD works by throwing code blocks (obj-c closures) into queues, and letting the runtime do its magic. You can have it execute code synchronously, asynchronously, or in parallel.

GCD will optimize and distribute your blocks the the available CPU cores. You can even enumerate using blocks, and instead of doing loop iterations one by one, it'll distribute them to the cores in parallel.

[1]: http://en.wikipedia.org/wiki/Grand_Central_Dispatch [2]: http://developer.apple.com/library/ios/#documentation/cocoa/...

Re:Node.js is Backwards by bittersweet on Tuesday June 14, 2011 @04:35AM (#2652267)
I've been hacking away on Obj-C and more specifically MacRuby and did some basic stuff with GCD already, using the async queueing system.

The distributed enumeration sounds interesting, could you point me in the direction of where I can find some more info about that?

Re:Node.js is Backwards by SeoxyS on Tuesday June 14, 2011 @02:25PM (#2654091)
You might wanna take a look at dispatch_apply with striding:

http://developer.apple.com/library/mac/#documentation/Darwin...

Re:Node.js is Backwards by BasDirks on Tuesday June 14, 2011 @02:40AM (#2652011)
Node is very nice for command line tools!