It is a really outdated 'language' today compared to Java, C#, and even C++.
If you look closly to objective C, it is really not a language, it is just C with a enhanced macro pre processor.
Performance is ABYSMAL compared to any modern language because message sends (the objective C equiv of a method call) has to go through a dispatch map. This is how it works:
1: you send a message to an object like [anObject doSomething];
this sends the doSomething message to the anObject object.
2: under the covers, this calls a function called regular function called objc-msg-send, this is part of the Objective C runtime.
3: this function looks up the object, then looks up the dispatch table to see if if can accept this message, then finally invokes it.
Overall, objective c message call performance is comparable to Javascript.
Now, of course you can just call C functions, but then what is the point of objective C?
Modern languages like Java, C# provide all the dynamsism of objective C, but do it effciently thougth vtables and reflection.
For a while I thought about porting some software we have to the Apple platform (it is currently written in C#), but with the abysmal performance of Objective C, the portion of the app turned out to be not usable (this is a parser that needs to make several thousand method calls per second). We ended up porting it to Java, and performance was a bit better than the original C# version.
So, while Objective C was a neat idea in the 80's, it is time to move on Apple.
Objective C was a great idea in the 80's but it is time to move on.
Steve Jobs, why don't you try some Java?
The platform SDK which includes the command line compiler, linker and debugger has allways been a free download (hasn't it). Also, the.net SDK which includes all the languages, libraries, and compilers has also allways been a free download, this is what sharp develop uses.
Really? .net suck?
Why is Objective C perfect?
Why does
It is a really outdated 'language' today compared to Java, C#, and even C++.
If you look closly to objective C, it is really not a language, it is just C with a enhanced macro pre processor.
Performance is ABYSMAL compared to any modern language because message sends (the objective C equiv of a method call) has to go through a dispatch map. This is how it works:
1: you send a message to an object like [anObject doSomething]; this sends the doSomething message to the anObject object.
2: under the covers, this calls a function called regular function called objc-msg-send, this is part of the Objective C runtime.
3: this function looks up the object, then looks up the dispatch table to see if if can accept this message, then finally invokes it.
Overall, objective c message call performance is comparable to Javascript.
Now, of course you can just call C functions, but then what is the point of objective C?
Modern languages like Java, C# provide all the dynamsism of objective C, but do it effciently thougth vtables and reflection.
For a while I thought about porting some software we have to the Apple platform (it is currently written in C#), but with the abysmal performance of Objective C, the portion of the app turned out to be not usable (this is a parser that needs to make several thousand method calls per second). We ended up porting it to Java, and performance was a bit better than the original C# version.
So, while Objective C was a neat idea in the 80's, it is time to move on Apple.
Objective C was a great idea in the 80's but it is time to move on. Steve Jobs, why don't you try some Java?
The platform SDK which includes the command line compiler, linker and debugger has allways been a free download (hasn't it). Also, the .net SDK which includes all the languages, libraries, and compilers has also allways been a free download, this is what sharp develop uses.
I just ported the java version of almabench to c#.
I also compiled the cpp version , with MSVC 7.0, pentium pro optimizations. I obtained identical results from pentium and pentium pro optimizations.
I ran the two programs on my 3 machines and the results are:
1: AMD AthlonXP 1900+, 512 MB, Windows XP Pro:
cpp: 25 seconds, c-sharp: 27 seconds
2: Intel Pentium3 1300, 1024 MB, Windows XP Pro:
cpp: 33 seconds, c-sharp: 36 seconds
3: AMD AthlonXP 1500+, 512 MB, Windows 2000 Workstation:
cpp: 39 seconds, c-sharp: 43 seconds
Looks like c-sharp compares pretty well with c++, my guess for the slowdown is the array boundry checking.
If anyone wants a copy of the cs version, send me an e-mail.