• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Function calling
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Function calling


  • Subject: Re: Function calling
  • From: Bob Ippolito <email@hidden>
  • Date: Wed, 25 May 2005 18:35:22 -0700


On May 25, 2005, at 6:26 PM, Theodore H. Smith wrote:

Of course strongly typed languages can be much faster. Think about it.

MyClass* OtherClass::MyFunc() {
    return &this->MyClassField;
}

void MyClass::Increment() {
    this->Value++;
}


OtherClass Fred; for (long i = 0; i < 10000000; i++) { Fred.MyFunc->Increment(); }

A good C++ compiler will compile this with no functions called! It will be all tight ASM code. Not that gcc is a good compiler, though. I think MrCpp (from MPW) could handle these kind of cool opts. But gcc I'm not so sure if it can do it on C.

As for Obj-C, these kind of opts are often impossible, because Obj- C is weakly typed.

And with an even smarter compiler (for a more declarative programming language) like Haskell, the compiler would know the answer already, and not bother to calculate it all at runtime.


-bob

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: Function calling (From: "Theodore H. Smith" <email@hidden>)

  • Prev by Date: Re: Function calling
  • Next by Date: Re: Function calling
  • Previous by thread: Re: Function calling
  • Next by thread: Re: Function calling
  • Index(es):
    • Date
    • Thread