Is there a ready-made implementation of an interpreter for ObjC. Basically, I need my program to be extendable via a scripting language.
I'm not sure if this is already provided by some kind of framework, or perhaps I can implement AppleScript internally - not sure how I would do that tho. It seems to only apply to automating the program itself, not for extending its own functionality.
Something similar to mIRC's means of interfacing with a scripting language.
You bet there is. It's called FScript; it's open-source and includes a console with a REPL in which you can interact with Cocoa objects. The syntax is Smalltalk-like, which is very similar to Objective-C -- the main difference is no square brackets. Here's some snippets from their tutorial. Notice that variables don't have to be explicitly typed!
> imageLocation := NSURL fileURLWithPath:'/Library/Desktop Pictures/Nature/Clown Fish.jpg'.
> image := CIImage imageWithContentsOfURL:imageLocation.
> image drawInRect:(200<>80 extent:600<>400) fromRect:image extent operation:NSCompositeSourceOver fraction:1.
You will be interested in their Embedding FScript Into Cocoa Applications Guide.
Do you just want your program to be scriptable? If so, then you should probably add AppleScript support. See Introduction to Cocoa Scripting Guide for information on how to do this.
Python and Ruby can interact with the Objective C calls so you can use them to extend the program's functionality.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With