agiliq agiliq - 9 months ago 137
Objective-C Question

Repl for Objective C

Is there a REPL for Objective C? I am learning Obj-C and sorely missing a REPL, coming from a Python background.

Answer Source

F-Script provides a Smalltalk-inspired REPL for Cocoa development, and Nu provides a lisp-based one. F-Script seems a bit more polished, and offers an object browser.

They both seem to be targeting OS X, rather than iOS development. There's scattered forum and blog posts with people describing using Nu for developing iOS apps, but they all seem to be from about two years ago. There's also a youtube video "Using a Scheme REPL to debug iPhone apps real-time" with a screencast of a fellow using Scheme to debug an iPhone app.

I haven't experimented with any of these technologies, but would love to hear from anyone who has.

EDIT: I just realized there's a simpler answer to all this. If you're coming from Python, and want to experiment with Cocoa in a REPL, you should just use the Python REPL. OS X ships with a Python to Objective-C bridge. Just run Python, do import objc, and you're off. There are also bridges for Ruby and Common Lisp, among others.

Of course, all these REPLs only let you write dynamic code to interact with Cocoa, but they don't let you write actual Objective-C code, and interpret it or compile it on the fly to interact with it dynamically. So none truly meets your original requirement.