The world of Apple fanatics can't get enough of the word "SproutCore" ever since WWDC. So I decided I'd give it a try. After reading everyone else's review, I suspected it'd be something like Prototype and script.aculo.us, and I really couldn't see the need for yet another JavaScript framework for graphics and XHR requests. I also didn't really see the open-source community going head-to-head with two of its own favorites.
What I found was completely different. Whereas Prototype and script.aculo.us try to take your webpage and make it more appealing, SproutCore wants to get rid of the page and make sure you are building a web app. For starters, it comes with its own widget set, so everything from buttons to combo boxes to text editors are themed, or you can just force them to use the system chrome. But under the hood is the most impressive thing: SproutCore is a complete MVC application, all in static JavaScript, HTML, and CSS.
And some Ruby. The SproutCore build tools are a lot like Rails, in that they are a Ruby Gem that you get with the traditional
sudo gem install sproutcoresproutcore hello_worldhello_world directory and type sc-server. Look familiar? Also like Rails, the initial sproutcore command creates a full directory, and there are many helpers, generators, etc that all build the project for you, so that creating your models, views, controllers etc is amazingly simple. Views are .rhtml files, just like Ruby on Rails, and are interpreted into static HTML/CSS via erb. Controllers and Models are JavaScript files, so you can put in whatever JavaScript you want as long as they implement the correct classes and respond to the required events.When you project is finished you run a single command to turn the whole thing into optimized, static HTML/CSS/JavaScript, and you can then upload that directory anywhere you want it, on any server and it will run. It can interact with any backend technology, so long as it responds in JSON and accepts standard POST and GET requests. This is a huge advantage over Ruby on Rails, where hosting is still expensive and finicky to get put together.
SproutCore isn't perfect. It's still pretty young (my installed version is 0.9.11) and the documentation is far from complete. There are many functions that aren't available yet, but I suspect that a judicious use of other popular frameworks will alleviate that particular pain. There is the question about loading your entire app into the user's browser, but to understand that you need to realize what arena SproutCore is competing in.
SproutCore isn't, as I first thought, an answer to Prototype, it's an answer to Flex and Silverlight. Where Flex takes an entire MVC app and wraps it in Flash, SproutCore wraps it in JavaScript (I haven't played with Silverlight yet, because I hate it. Not because it's Microsoft per se; I would have hated it if it was from Google. I just really don't think we need another plugin-based browser programming language. But that's another article). This is refreshing because it does away with the plugin and works with native browser technology.
Now I have to say: I really do like Flex. Adobe has done an excellent job of turning Flash into a business tool, and the AIR runtime is just too easy to use. But it's clear that Flash on the iPhone is a distant dream, so people who work on that platform are going to lose out. For that matter, waiting for each individual vendor to implement a Flash plugin for their mobile device is fraught with frustration, so it's nice to have a fallback that will work on any even reasonably standards-compliant browser.
So my recommendation is to give it a shot. Learning new technologies is always beneficial, and this one seems to be a real up-and-comer, if only because Apple is putting a lot of money behind it.