J. David Bryan wrote:
I'm still not clear on Adriaan's original point, though. Does GPC currently support Objective-C message passing syntax,
I don't think it does.
such that having such support in any intermediate language utilized by a revised GPC compiler would be crucial?
I wouldn't say it is crucial in the sense that it is a requirement to support interfacing to Objective-C. However, if the target language you translate to supports Objective-C interfacing already and does so well, then you can save yourself the effort translating all the way down to the low-level C API of the Objective-C runtime. You can translate to the (hopefully) higher level statements of the target language and let the target language's compiler do the heavy work for you.
For example, when using Objective-C style message passing syntax in Objective Modula-2 ...
VAR foo : NSArray := [[NSArray alloc] init] ;
for the ObjC target, the above only needs to be translated to
NSArray *foo = [[NSArray alloc] init ;
which is very straight forward. However, for an C target, there is a whole lot more to be done to translate just this one line.
First the translator needs to determine that the receiver NSArray is a class and the message alloc represents an instance instantiation, then determine the allocation size, then call the ObjC runtime API
id class_createInstance(Class cls, size_t extraBytes)
Then the translator needs to obtain a so called selector for "init" then determine which type of message sending function applies (there are four) and call the ObjC runtime API
id objc_msgSend(id theReceiver, SEL theSelector, ...)
all of which requires considerable boilerplate code to be generated. If there are messages that pass parameters, the boilerplate code gets still more elaborate.
Adriaan is probably concerned that if the target language doesn't do this work already, then whoever maintains GPC is probably less likely to want to do the work to add support for an Objective-C interface.