Exploring the Mac OS X Object System
Philippe writes "F-Script is an integrated set of tools that makes it possible to interactively explore and manipulate Cocoa objects as well as script them using new high-level programming techniques. This new article, Exploring Cocoa with F-Script, shows you how to use some of its most impressive features and demonstrates how it can be a useful addition to your developer toolkit."
I've seen Cocoa scripted with PyObjC and python Cocoa bindings.
Apple currently employs one of the maintainers of PyObjC.
Would someone informed care to explain if/when F-Script would be a better choice?
I was wondering how many Mac-specific development platforms are out there. Obviously there are loads of them for Windows, but how many just for Mac?
As much as this will get me flamed, I code in Java when I am writing applications for Mac. I find it works well enough, but I am interested in becoming a bit more versitile.
Information wants a fueled airplane waiting at the hangar and no one gets hurt.
Is that you?
Join Tor today!
...is the trash can?
Or is that Vista I'm thinking of?
...but is giving everything access to everything else in this way safe?
Just an FYI, you can get the same functionality as a tabbed editor in XCode by setting the editor to use only one window. Double click on a file in XCode, then on the right side of the toolbar is a button which will change the editor mode and open all of the editors in one window. Then you can use Control-1 to switch between editors.
Not sure if you were aware of that feature.
seSales, Point of Sale software for OS X.
InterfaceBuilder makes the bindings in the MVC architecture for you when you connect them graphically. Once you get the hang of which object creates the event and which object should receive it then this becomes very straightforward. That being said, you can code by hand if you wish. I don't have the reference on me, but I believe the Hillegass book
"Cocoa(R) Programming for Mac(R) OS X (2nd Edition)" demonstrates coding an example application this way.
'The tyrant will always find pretext for his tyranny.' - Aesop's Fables
Um...have you done any programming on the mac, AC? Carbon is the cleaned up legacy API of the pre-OSX days. The idea was that you wrote to Carbon when developing your OS9 app, and then it should pretty much run unmodified in OS X (presuming a recompile to make it OS X native lest your app fire up the classic layer).
In that regard, Carbon is meant to run on other platforms only if you consider OS9 another platform. I think you are thinking that Objective C is somehow a bastardized version of C. It's not; Objective C is the full C language with additional object-oriented components a la C++, but not to the extreme that C++ takes it. Plus, Objective C gives you run time typing, which C++ does not provide (static, compile-time typing). This makes it very easy to get information about objects and is the basis of the key-value system that runs most of Cocoa. Objective C is inspired by Smalltalk and uses a number of its concepts whilst C++ was influenced heavily on Simula2 (I'm pretty sure). Regardless, both can call strncpy(), malloc() etc. if you want.
If you want write truly cross-platform C, you write to the standard C API *only* and let the users get their input and output via stdin and stdout. Not very graphical, but hey, you want cross platform, right?
I have used F-Script to write tests for my applications for quite some time. In fact, pretty much everything I write has an F-Script console built into it when DEBUG is on. Naturally, OCUnit is nice for built-in unit test, but I really like being able to write an impromptu test into the F-Script console real quick to exercise some newly written or changed code. My clients often do not give me much time for writing enough built-in tests, so F-Script helps me pick up the slack with convenient, live testing. On the bad side, with F-Script, you are relegated to writing non-portable tests with odd, SmallTalky syntax, but for me it is an acceptable compromise for such a good, free (as in beer), on-the-fly testing tool. I don't remember having thanked Philippe for making it available. Thanks, Philippe!
Are you the same AC that was trolling this on Digg.com?
Sure, MS needs to do something smarter than repeat the Longhorn disaster, but I really doubt that BG and Monkey-boy have the guts to admit that they can't ship a major revision to their OS anymore.
-jcr
The only title of honor that a tyrant can grant is "Enemy of the State."
The article seems to be more about exploring class libraries, not "the object system" (which would mean low-level analysis of how methods are invoked etc.).
Furthermore, there is little that is OS X specific about either the class libraries or the object system: the object system comes from Smalltalk, via Stepstone, and the class libraries come from NeXT and borrow heavily from Smalltalk and also exist in GNUStep (and, yes, people are working on porting FScript to GNUStep).
I was not aware it was possible to do things like that with Objective-C. It's neat.
There are several other scripting environments for Cocoa, including bridges for Ruby, Python, Perl and Lua. AFAIK they don't have graphical tools like those provided by F-Script for playing with Cocoa objects.
ugh, I can't believe Rob Malda would do such a thing. I guess that's what happens when you no longer matter.