Cycript: Blending Objective-C and JavaScript

If you're wondering what exactly this is, the Cycript page offers some examples of code written with Cycript. Basically, it allows you to implement full JavaScript commands, while working with Objective-C in the same project.
Cycript is dependent on the MobileSubstrate and libffi libraries, which are available in Cydia. This won't be used to develop applications in the App Store anytime soon.
If you're interested, you can download examples or releases of Cycript. It's still being worked on, but if you're developing with both Objective-C and JavaScript in a project, you should check it out.

![TUAW [Cafepress]](http://www.blogsmithmedia.com/www.tuaw.com/media/tuaw-cafepress-promo.png)


Reader Comments (Page 1 of 1)
Frank said 2:23PM on 11-18-2009
What exactly does this bring to the table that's unique/different/better than what already exists? How would you compare this to other implementations?
There is already a very nice implementation by the folks at 280North.com called Objective-J with a corresponding API Framework called Cappuccino that mirrors the Objective-C and Cocoa framework experience that Mac developers are familiar with. Details here:
http://www.cappuccino.org
Toss in Atlas, which aims to bring Interface Builder-like features to this Objective-J/Cappuccino world once it's done, and anyone interested in doing things using JavaScript in the browser but with the language syntax of Objective-C and the development model of Cocoa should be in heaven. Details on Atlas here:
http://280atlas.com
And for a sample of what's possible with the Objective-J/Cappuccino toolchain, look no further than 280North's web-based take on Apple's Keynote program (think MS PowerPoint for Windows users):
http://280slides.com
Note Objective-J/Cappuccino are completely free. Atlas, currently in a paid beta, will not be.
Reply
Jay Freeman (saurik) said 11:20PM on 11-18-2009
This comment doesn't make any sense.
Objective-J is an implementation of Objective-C for JavaScript. Cycript is a binding from JavaScript to Objective-C.
Objective-J is used to write applications in web browsers using Objective-C semantics and syntax. Cycript is used to write actual iPhone and Mac OS applications using Objective-C libraries from the host language of JavaScript.
The only things they have in common are that they both involve JavaScript and Objective-C, but even the specific meaning of Objective-C is different in both cases.
If you want to ask "how is this different than ", you should be talking about JSCocoa, which solves much the same need (although has different initial design decisions, as discussed on the Cycript website).
Rick said 5:40PM on 11-18-2009
This is all well and nice, but for those of us who are really duffers out there, when are we going to see a visual basic implementation for the iPhone?
Rumor has it that NSBASIC developed an implementation of Visual Basic for the iPhone, but couldn't get it through the Apple guys because of API's. Is this something that will be on the horizon for the future?
I have so many apps in mind for this device, but I don't want to spend a truck load of money getting a developer to do it or lose control of the whole process. I simply do not have the time to sit and learn Objective - C. Believe me I've tried.
Surely this will be something that is around the corner.
/
Reply
drunknbass said 11:57PM on 11-18-2009
this is not like that.. at least thats not what people who are using it currently use it for.. this is similar to jscocoa.
right now its used to attach itself to a running process via command line to alter a live app while its running... hooking into functions.. controlling objects etc.
its its pretty damn cool
Frank said 2:27PM on 11-22-2009
@Jay Freeman (saurik),
Thanks. Originally read this too fast and had Objective-J on the brain, so read it a** backwards. My bad. Sitting here now, re-reading the post, I get it now.
Reply