Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Good or bad, I'd say Apple are pretty much stuck with ObjC. Cocoa and all the other frameworks OS X uses are written like they are because of the language's syntax. This is demonstrated by how crappy the PyObjC code looks (compared to "regular" Python):

    notificationCenter.addObserver_selector_name_object_(
        notificationHandler,
        "handleMountNotification:",
        NSWorkspaceDidMountNotification,
        None)
To make it work with some other language (say, C#/C++/Ruby/Brainfuck/Python or whatever) would basically be a complete redesign of the framework, which in turn would basically be a complete redesign of OS X.. And why? Objective C is a perfectly decent language.. I'm not sure anyone would be using it where it not for Carbon/Cocoa, but it's not a bad language at all


MacRuby:

  notificationCenter.addObserver(notificationHandler, 
                        selector:"handleMoundNotification",                
                        name:NSWorkspaceDidMountNotification,
                        object:nil)


Yes, the messaging syntax (which is very expressive) makes it hard to use other languages with Cocoa, but not all. Your example in F-Script gives:

  notificationCenter addObserver:notificationHandler
                     selector:#handleMountNotification:
                     name:NSWorkspaceDidMountNotification
                     object:nil




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: