Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How abstract is Objective-C compared to Lisp? [closed]

I am coming from Lisp and wish to develop an Iphone app. I was hoping to hear from other lisp or python developes on how Objective-c compares to Lisp in terms of abstractions, such as closures, first class functions, macros, etc.

like image 882
yazz.com Avatar asked Apr 23 '11 13:04

yazz.com


People also ask

Is Objective-C faster than C?

Objective-C is slightly slower than straight C function calls because of the lookups involved in its dynamic nature.

How similar are c++ and Objective-C?

While they are both rooted in C, they are two completely different languages. A major difference is that Objective-C is focused on runtime-decisions for dispatching and heavily depends on its runtime library to handle inheritance and polymorphism, while in C++ the focus usually lies on static, compile time, decisions.

Is Objective-C compiled or interpreted?

Objective-C is certainly a compiled language.

What is in Objective-C?

It's a superset of the C programming language and provides object-oriented capabilities and a dynamic runtime. Objective-C inherits the syntax, primitive types, and flow control statements of C and adds syntax for defining classes and methods.


1 Answers

Objective-C has its history rooted in SmallTalk, and as a consequence, like Lisp, a lot of what makes the language useful exists in functions (in this case, methods of classes) that you can override at runtime with your own code and can add functions at runtime to classes. But, in Objective-C the underlying C is never very far away, so unlike in Lisp you do have to worry about things like memory management and the language is obviously more procedural than functional.

Recently Objective-C compilers added support for "blocks", i.e. closures.

Of course, Objective-C is still a compiled language and everything that gives it features you would expect to find in Lisp, Python, or SmallTalk is built on top of that. I might get some down votes for it, but given your background I think you'll find Objective-C to be about the nearest thing to developing in a fully dynamic, interpreted language that you can get right now while with a compiled language.

Just in case you haven't checked or someone coming along later to read this question needs it, have a look at the Wikipedia section on Objective-C syntax.

As a P.S., depending on what you're doing you might also be interested in tools like PhoneGap that let you develop for iPhone (and other mobile platforms) in JavaScript, since JavaScript, despite its name and C-like syntax, has a lot of the power you are used to having in Lisp.

like image 156
G Gordon Worley III Avatar answered Nov 15 '22 08:11

G Gordon Worley III