[Mono-list] Is Objective-C support possible?

Miguel de Icaza miguel@ximian.com
17 Sep 2001 00:04:12 -0400


> The primary problem will likely be things like forward invocation
> and class extensions (categories) which Java doesn't implement. ObjC
> is far more flexible than Java.

It should actually be possible to implement Objective-C with the .NET
framework.  Even categories should be possible to support.

In Objective-C method invocation is always done at runtime, and there
is very little support at compile-time for it.  Every method
invocation is performed by the runtime.

For example, the compiler will translate:

	[object someMethod: "hello"]

Into a call to a general message sending routine:

	__msgCall (object, "someMethod", "hello")

It should be pretty simple to implement __msgCall, specially given
System.Reflection.Emit's capability of generating code on the fly.

Categories can be trivially implemented by having your `__msgCall'
function cope with it.  

That does not mean that an Objective-C program will be immediately CLS
compliant at every level, but it is a start.

Best wishes,
Miguel.