[Mono-list] Re: Is Objective-C support possible?
Fri, 15 Feb 2002 17:11:53 -0800 (PST)
> As IL is a simple, stack-based language, as with Objective C, you will
> have to use reflection to dynamically add methods to an object. In which
> case, performance will be your biggest enemy. As for the amount of
> overhead from using a dynamically typed language with the CLR, the best
> way will be to try it and see.
You may want to take a look at the paper:
T. M. Breuel: "Implementing dynamic language features in java using dynamic
code generation. In Proceedings 39th International Conference
and Exhibition on Technology of Object-Oriented Languages and Systems.
It's available here:
Basically, if you have code generation (which CLR does, just like
the JVM), you can implement dynamic changes to classes efficiently.
Those techniques seem like a particularly good match to Objective-C
semantics because methods tend to be added dynamically in dynamically only
when classes are dynamically loaded. Furthermore, using the adapter
technique described in the paper, you could create method adapters
such that almost all dynamic method calls would go through type-correct,
statically typed CLR method calls.
So, I think Objective-C's dynamic object system can be implemented
efficiently on top of the CLR and the JVM without too much trouble.
A much bigger problem is going to be the "C" part of Objective-C.
People really do use lots of unsafe C constructs in Objective-C,
which leaves you with the choice of compiling that into unsafe CLR
code (not good) or greatly changing the semantics of Objective-C.
In fact, if you like the dynamic/static model of Objective-C, it
might be better to just design a kind of Objective-C# or implement
the TOM language, a safe successor to Objective-C.
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games