Welcome, Guest. Please login or register.

Author Topic: Native Objective-C compiler available  (Read 3953 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline falemagnTopic starter

  • Sr. Member
  • ****
  • Join Date: May 2002
  • Posts: 269
    • Show all replies
    • http://www.aros.org/
Native Objective-C compiler available
« on: November 25, 2003, 10:10:11 AM »
It compiled out of the box, and appears to function properly, although I didn't have that many ObjC programs to test it with, so beware and pay the usual attention you pay with beta software.

If you're interested, you can find it here: http://www.aros.org/downloads/gcc-objc-3.3.1-aros.tar.bz2

Just unpack it in the same directory where you unpacked the gcc/g++/binutils archive, and then you're ready to start compiling Objective-C stuff.

Enjoy :-)
 

Offline falemagnTopic starter

  • Sr. Member
  • ****
  • Join Date: May 2002
  • Posts: 269
    • Show all replies
    • http://www.aros.org/
Re: Native Objective-C compiler available
« Reply #1 on: November 25, 2003, 10:21:12 AM »
Quote
Maybe this is a weird question... But what is Objective-C?


Ehm... a programming language?! :-)

Look here for more info.
 

Offline falemagnTopic starter

  • Sr. Member
  • ****
  • Join Date: May 2002
  • Posts: 269
    • Show all replies
    • http://www.aros.org/
Re: Native Objective-C compiler available
« Reply #2 on: November 25, 2003, 02:58:33 PM »
Quote
Objective-C is meant to be very nice, never used it myself but I've never heard any complaints about it.


Ok, here's one: it's slow. :-) ObjC has dynamic typechecking and methods invocation is achieved via something akin AmigaOS' BOOPSI dispatchers, with the exception that ObjC dispatching can be a lot slower due to the fact that the "methodid" is the hash value of the method name, and computing hash values is slow.

Add to that the strange syntax, completely foreign to the C syntax, it uses for classes interfaces/implementations and methods invocation, and you get another complaint. Whooo, we've got already two of them! :-)

Quote
I've never heard anything but complaints about C++!


Well, C++ isn't perfect, but it has its enormous advantages over ObjC.

Quote
IIRC The syntax is a lot closer to Java.


Not really, Java's syntax is practically the same as C++'s one.
 

Offline falemagnTopic starter

  • Sr. Member
  • ****
  • Join Date: May 2002
  • Posts: 269
    • Show all replies
    • http://www.aros.org/
Re: Native Objective-C compiler available
« Reply #3 on: November 26, 2003, 01:23:59 AM »
Quote

crystall wrote:
Quote
Ok, here's one: it's slow. ObjC has dynamic typechecking and methods invocation is achieved via something akin AmigaOS' BOOPSI dispatchers, with the exception that ObjC dispatching can be a lot slower due to the fact that the "methodid" is the hash value of the method name, and computing hash values is slow.


This depends heavily on implementation, dynamic method calls in C++ can be just as slow. AFAIK Apple's implementation of Objective-C is very fast, basically the system keeps a cache of dynamic method calls to avoid to recalculate each and every time hash values, it works pretty well.


Yes, well, a simple caching mechanism is the least I'd expect from any objc runtime implementation, and it's the same technique implemented by gcc's runtime, however a method invocation is still about 3 times slower, in the average case, than a C++ virtual call (I'm citing some benchmarks I read about some time ago on the net).

In any case, where speed is not everything, I agree ObjC has its usage. It could be used for GUI stuff, for instance, and there the dynamic method dispatching and typecheckign can have its usages as well.

Quote

Quote
Add to that the strange syntax, completely foreign to the C syntax, it uses for classes interfaces/implementations and methods invocation, and you get another complaint. Whooo, we've got already two of them!


Yeah, that can be a problem, Obj-C syntax was borrowed from smalltalk so you can like it or hate it. Personally, having used BOOPSI a lot (which is quite influenced by smalltalk IMHO) I find it nice. Apart from class/methods definition (which are different from plain C even in C++)

Well, you simply need to put the class' name before the method's name. Not really that big difference.

Quote
the only addition to the language is the method call which is much different from a C function call and thus makes it pretty clear where you are using dynamic calls and where you're not.


But how do you know whether a simple function call doesn't make use, in turn, of a dynamic call?