Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an Objective-C Interpreter for the Mac? [closed]

Sometimes it's nice to open an interpreter, type out some code and see if it's working, rather than having to compile something large like an Xcode project just to quickly test something. Does an Objective-C Interpreter exist for the Mac, or am I out of luck?

UPDATE: There's a paid program in the App Store called CodeRunner, which lets you run Obj-C quickly (and several other languages). It's not an interpreter, but works pretty well for testing out ideas quickly: http://itunes.apple.com/us/app/coderunner/id433335799?mt=12

like image 717
Dave Avatar asked Aug 26 '11 23:08

Dave


People also ask

Is Objective-C still supported by Apple?

Most of the core iOS and MacOs software is still written in Objective-C, though Apple is pushing for new updates to be written in Swift.

Is Objective-C still used 2022?

Furthermore, Objective-C is a piece of art, creators packed genius solutions and were constantly improving it, so us developers were able to use it at our advantage. There are a lot of indicators telling us there's still a ton of legacy Objective-C code, both from Apple and from other developers, that's still in use.

Is Objective-C obsolete?

To sum it up, Objective-C, when compared to Swift, is a more outdated language and lacks modern tools and properties.

What is Objective-C in iOS?

Objective-C is the primary programming language you use when writing software for OS X and iOS. It's a superset of the C programming language and provides object-oriented capabilities and a dynamic runtime.


2 Answers

You can use F-Script, which is Smalltalk-based, but lets you interface with Cocoa. You can also embed it in your application, to let you inspect views and other things at runtime. It's quite useful. Edit: as pointed out in the comments, there are other great language bridges available, like PyObjC, RubyCocoa/MacRuby, Nu, etc. CINT is an example of a C interpreter, but not Obj-C.

As for an actual Objective-C interpreter, I don't think one really exists. But it's not too hard to set up a "Command Line Tool" project in Xcode, which gives you a really simple main.m file to try something in.

like image 196
jtbandes Avatar answered Nov 02 '22 10:11

jtbandes


For those arriving here late: Take a look at Tosti. A basic but pretty functional Objective-C interpreter.

It's a side-project I put on GitHub as there seems very little available at the moment. I'm using it to do some remote debugging. Support available.

like image 29
leo Avatar answered Nov 02 '22 09:11

leo