[Theory] How to speed up python code execution / pypy vs GPU

Steve D'Aprano steve+python at pearwood.info
Sat Nov 5 20:52:51 EDT 2016


On Sun, 6 Nov 2016 08:17 am, Ben Bacarisse wrote:

> Steve D'Aprano <steve+python at pearwood.info> writes:

>> Here's the same program in Objective C:
>>
>> --- cut ---
>>
>> #import <Foundation/Foundation.h>
>>
>> int main (int argc, const char * argv[])
>> {
>>         NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
>>         NSLog (@"Hello, World!");
>>         [pool drain];
>>         return 0;
>> }
>>
>> --- cut ---
>>
>> Which would you rather write?
> 
> That's a rather odd comparison.  Why not
> 
>   #import <stdio.h>
> 
>   int main()
>   {
>     printf("Hello world\n");
>     return 0;
>   }


Because that's not Objective-C? (This is not a rhetorical question.)

I'm not an Objective-C expert, but to my eye, that doesn't look like
Objective-C. It looks like plain old regular C.

Here's where I stole the code from:

https://www.binpress.com/tutorial/objectivec-lesson-1-hello-world/41

and its not too dissimilar from the versions here:

http://rosettacode.org/wiki/Hello_world/Text#Objective-C


> ?  It's decades since I wrote any Objective-C (and then not much) but I
> think this is the closest comparison.



-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.




More information about the Python-list mailing list