Sony's next-gen application platform built on Objective C/GNUStep
snap.sonydeveloper.com
snap.sonydeveloper.com
That, and Cocoa was not designed by morons - protocols and delegation, not inheritance, rightfully rule the day.
There are 7 delegate callbacks, 2 of which are voids so they're not really delegation methods. There is also a large list of UIControlEvents also sent around value change and touch events. Lastly 3 NSNotifications can also be dispatched by this object when data changes.
Some of the list components are equally bad. The rule of thumb for ideal delegate vs event models is this. If you need a value returned, it should be a delegate method
- (UIView )viewForZoomingInScrollView:(UIScrollView )scrollView
but if a callback returns no data, it should not be a delegate but rather an event
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
there is no reason for a void method to only allow for one listener and it's bad design.
In yet more words, "late binding".
I'm trying to like Objective-C but I don't. It feels like coding simultaneously in two different languages and you're never quite sure which one will be less painful to use.
It makes you write statically typed code, but you still can't figure out what methods a class has in the IDE. On top of that half of a protocol usually doesn't need to be implemented but you have no idea which parts, and the IDE again can't just fill it out for you. I find I spend more time looking through documentation and copying interface signatures than coding. It has some kind of 'automatic memory management' but it seems barely better than that of C. On top of that if you get a compiler error it usually points you to a piece of code that has nothing to do with the actual error. I'm sure Objective-C was impressive in 1986, just like Java was in 1994, but it's 2010.
Maybe I don't understand what you mean but isn't that just an XCode auto-completion feature? Do you mean you can't see which methods belong to the class and which are inherited?
> It has some kind of 'automatic memory management'
Initially I was not too impressed by the alloc/retain/release/autorelease parts of Obj-C but now that I grok the concept well, I think it's awesome. I'm only coding for iOS devices but my understanding is that for OSX, there is a stable GC system. On iOS, you manage the memory yourself. I would have liked to not worry about memory at all but it's not a big deal after all. If you alloc/copy something, make sure you release it.
Lots of things individually in Obj-C/Xcode are minor annoyances, but when you add them all together it's a very annoying toolchain. Comparing the UI/Polish in Apple products to Microsoft products, I figured that XCode would be one of the best dev environments ever. I think it's one of the worst.
It's not that any of the issues are insurmountable, I'd just rather not deal with them.
Thankfully the next version will intelligently incorporate Clang/LLVM which will improve the situation vastly.
The one redeeming quality is that Instruments and the tools package is quite nice. Our company pays good money to get the same level of software for visual studio.
I mean the intellisense (autocomplete + docs
+ method signature) in xcode blows chunks
compared to Visual Studio or even Eclipse.
That last sentence left me puzzled, seeing as how eclipse has much better "intellisense" for java than VS does for c++ & c# (at least out of the box - resharper brings it close to eclipse-levels with c#).And if for whatever reason Resharper isn't available to you, then check out the Productivity Power Tools. They'll take you in the Eclipse direction. Not all the way, mind you, and they're buggy, but it's helpful nonetheless.
Could you explain the difference?
A retain count (a count on other parties with an interest in an object) is maintained by the runtime. When the retain count reaches zero, the object is freed. When an object is created (using alloc or copy), it has a retain count of 1. Another object can express its interest by calling the "retain" method. When it is done, the "release" method should be called.
If an object is being returned, but shouldn't be freed right away, there is a mechanism called "autorelease" where the call to release is delayed until the end of the current runloop, giving other objects a chance to retain the returned object.
Cocoa uses autorelease pool for short-lived objects, so most of the time you don't have to free them.
For long-lived objects you can use synthesized properties which handle retain/release for you.
In other cases you "guard" your use of object with retain/release. You can use these in pairs in the same place, rather than having malloc() in one part of the program, and free() in another.
You can freely pass reference to an object without worrying that you might free it while it's still referenced somewhere else. You don't have to think about ownership of an object.
With C, you are forced to care who actually allocated something and figure out a protocol for dealing with getting it released.
With Objective C, I can allocate something, hold my reference for the duration of the call, release my reference and return it. If the caller wants a reference, they can then grab it; if they don't, it will get deleted.
If you're alluding to cost of message send, then it's pretty low, and can easily be made faster in case it becomes noticeable:
http://www.mikeash.com/pyblog/performance-comparisons-of-com...
I highly recommend reading the tour of objc_msgSend [2]. It's very eye opening: for example, there's a cache scanning loop even in the fast case.
[1]: http://www.mulle-kybernetik.com/artikel/Optimization/opti-3-... [2]: http://www.friday.com/bbum/2009/12/18/objc_msgsend-part-1-th...
Hmm, check the results in the same page for the 64bit Cocoa runtime. This is where most optimizations are made, because Apple used the 32->64 bit transition as an opportunity to do most binary compatibility breaking changes to the language.
There, in 64bit, the IMP cached msg send is actually FASTER than C++ virtual method dispatch.
And if your app's performance suffers because of method calls / msg sends, you are doing it wrong. They should be an insignificant amount of time compared to the actual processing stuff done by your app.
And all the rest of your "language criticism" is all about the IDE. Coincidentally all solved by Xcode 4: better autocomplete, automatic fixes, relevant error descriptions, etc. The main problem was GCC --it just didnt provide the info and interfaces to use for real time, AST guidance of the IDE. In XCode 4 Apple implemented all that stuff leveraging LLVM.
Apart from that, Xcode < 4 was not a bad IDE by any standard. Worse than Eclipse/VS in several ways, yes. Bad is a stretch. It also has excellent profiling tools, and a great GUI editor (Interface Builder) that gets MVC right.
Also: obj-c has had real GC for years by now. And the old scheme, still used in iOS of retain/release in not "barely" but extremely better and easier than C, while maintaining the performance benefits.
It will be interesting to see transition difficulty from one implementation to the other.
At the very least, Linux is going to get a serious push for GNUStep, and a ton more dev's if it works out.
http://fireballed.org/linked/2010/11/24/snap/
EDIT: Site's nuked for me. Main page cache from the fireballed.org site:
Sony’s Networked Application Platform is a project designed to leverage the open source community to build and evolve the next generation application framework for consumer electronic devices.
The developer program gives access to a developer community and resources like SDK, tools, documentation and other developers.
The foundation upon which this project is base comes from the GNUstep community, whose origin dates back to the OpenStep standard developed by NeXT Computer Inc (now Apple Computer Inc.). While Apple has continued to update their specification in the form of Cocoa and Mac OS X, the GNUstep branch of the tree has diverged considerably.
The GNUstep core libraries strictly adhere to the OpenStep standard and OPENSTEP implementation. They consider changes and additions to their API only under the following circumstances:
They add methods and classes, either from Cocoa or their own extensions, if they add substantial value and don't interfere with OpenStep and/or Cocoa compatibility. They generally don't remove things unless there is a clearly better implementation in newer Cocoa API Where there is a real problem with a change, they will attempt find a technically superior work-around. In rare cases, this might involve a change in the original OpenStep API
We depart somewhat from the GNUstep adherence in that our goal is to thoroughly modernize the framework and optimize it to target modern consumer electronic (CE) devices. These modern conveniences include such features as touch displays and 3D graphics.
I loved the hardware of a Sony MP3 a bought a couple of years ago but it was ruined by absolutely atrocious syncing software. I hope this means they open up their interfaces a little more and let other people integrate with their products.
Quoth the raven: SNAP is a completely open-source licensed (for license details click here) development environment based on GNUstep.
Historically, GNUstep is based on the OpenStep specification developed by NeXT (now Apple Computer Inc.) plus additional extensions added by Apple through the Cocoa framework. SNAP is an extension of this framework created by Sony and will take a big step forward in evolving a new application framework.
The initial areas of enhancement target the windowing system and graphic framework but further modifications and refinements address networking, widgets, UI building, 3D graphics, file system, garbage collection, performance and execution size. The overall goal of the SNAP project is to develop and evolve a next generation native application framework for embedded devices. While SNAP does not currently target a specific hardware platform or product, the long-term goal is to enable SNAP on Consumer Electronic (CE) devices.
Sony had, a long time ago, a family of Unix workstations. At that time, those systems were called "open" in the sense that they played well with other systems over documented protocols.
That's what I hope too. While Cocoa has grown into a powerful API, the development on GNUStep has stalled.
Interesting, that there's no word about the Cocotron project (http://www.cocotron.org), even though they seem to have similar goals.
Pretty curious how this is going to work out.
we are all well aware of apple's successes in the last few years, but they all seemed to be happening in their own little walled-off corner of the world. it's typically apple's tech versus the rest of the industry. now here's a sign that apple's influence is being felt at even deeper levels.
i guess webkit was another sign of this, but that doesn't seem as stark as some other company adopting objective-c.
Along with WebKit, I'd say that app stores and touch UI are other areas where Apple has been influencing tech in recent years.
I don't think it had any influence on this decision.
http://tech.slashdot.org/story/06/12/26/0342200/GNUstep-Proj...
ie: "by Psychotria (953670) ...I think this dude is a complete moron..."
Looks like Greg proved them wrong. As they say: "Living well (or rather: doing well in this case) is the best revenge."
EDIT: You can see info about SDK stuff on Google's cached version of some pages.
EDIT 2: You can still download the SDK here: https://snap.sonydeveloper.com/common/pages/documents/view/?...
This is how Trolltech used to charge money for commercial use of Qt. Qt was dual-licensed under the GPL and a commercial license, so GPL'ed software could freely use the library, but non-GPL software would have to pay for the commercial license.
I should start writing * GPL as I do with * BSD
As for linking proprietary code do GPL'ed libraries, the license is not explicit. However, according to Larry Rosen (http://en.wikipedia.org/wiki/GNU_General_Public_License#Poin...) linking, even statically, does not make a derived work (that would be subject to being GPL'ed by accident). Also, the GPLv3 has some different wording. I understand the GPLv3 makes it less likely a program linked to a GPL'ed library will be considered derivative.
From the GNUStep site (http://www.gnustep.org/information/aboutGNUstep.html):
"The GNUstep libraries are covered under the GNU Lesser (Library) Public License. This generally means you can use these libraries in any program (even non-free programs) without affecting the license of your program or any other libraries GNUstep is linked with. If you distribute the GNUstep libraries along with your program, you must make the improvements you have made to the GNUstep libraries freely available."
Most places I've lived you could throw a shoe and hit a Java developer or a Windows (VB/.net) programmer, but you could set a nuke off and not kill any Objective-C programmers.
I think NeXT and Apple never really bothered promoting it outside of the US. Australia has just about the highest level of iPhone usage per head of population, but prior to the iPhone coming out jobs for Objective-C were running at something like one per N-thousand Java jobs. Now the iPhone pops up, and all of a sudden everybody wants an Objective-C programmer with 5 years experience and proven commercial success on the iPhone... well... guess what... you reap what you sow. Because virtually nobody in Australia invested in Mac programming for all those years, you now don't have a deep pool of talent to dip into.
But a similar thing may happen with Android ... anyone that didn't invest in Linux programmers is at a disadvantage.
(In 2001 I found myself looking for work with 10 months' of Java experience, and 8 years of NeXT experience. I doubt anyone hiring had any clue what Objective-C, NeXT, OpenStep, EOF were. Certainly the HR drones didn't.)
Back in the NeXT days, I think interest was primarily in US/UK/Germany, with some interest in France and Japan and maybe some Swiss activity due to the investment banks.
To me, the most interesting aspect of this is that Sony did all this without communicating with the GNUstep community. We don't yet have a clue what the extent of their changes are, or what components were used or not used, so it's impossible to say whether Sony's work can directly benefit GNUstep.
COLLADA looks like an XML based digital asset interchange format.
SNAP is Sony's Networked Application Platform and is intended to be the basis for future consumer electronic devices. It is planned to evolve this into a complete software stack that will allow third party applications to run on Sony consumer electronics products. This Linux based software stack will include operating system, device specific middleware, general and device specific Objective C APIs including GNUstep, and key applications. The SDK will provide the necessary tools to begin developing Objective C applications for the SN Application Platform.
On a typical CE device hardware resources are much more limited than in the average PC or even a netbook. In order to get the most out of the available hardware it is therefore necessary to control access to scarce resources and manage their use and coordinate sharing them between applications. This is one goal of the SNAP stack. The other one is to provide the application developer with easy to use libraries to access all capabilities of the underlying hardware without reinventing the wheel.