[linux-audio-dev] Objective-C (was: gcc, you let me down...)

Steve Harris S.W.Harris at ecs.soton.ac.uk
Mon Jun 6 10:05:58 UTC 2005


On Mon, Jun 06, 2005 at 11:07:03AM +0200, Toby wrote:
> Enter Objective-C:
> 
> - STRICT SUPERSET OF C: every valid C program is a valid ObjC program.
>   This makes it trivial to include or link to C code and libraries and
>   to mix procedural, object-oriented and ASM code in the same *file*.
> 
> - SIMPLE: ObjC is plain C with one syntax addition and a few new
>   keywords.  It only extends the C language to support Smalltalk-like
>   object-oriented features, because that's all you're going to need.
>   No more operator overloading, templates, references, 'const', etc.
> 
> - DYNAMICALLY TYPED: messages (method calls) are delivered according to
>   the dynamic type of the target object, not to some static type.  This
>   is how Python works.  You can even send an object a message that is
>   not specified in its interface.  This might seem like a bad idea, but
>   instead it allows for powerful delegation-based design patterns.
> 
> - FAST: Objective-C performs dynamically bound message calls very
>   quickly, about 1.5-2.0 times as long as a plain C function call!

Really? When I benchmarked it, it was more like 2-20x in the real world
(with inlined functions and so on). Still, I'l agree ObjC is pretty good.
Its possible to do static pre-discovery of the message issuing, but then
the syntax get really ugly.

- Steve



More information about the Linux-audio-dev mailing list