[Theory] How to speed up python code execution / pypy vs GPU
Ben Bacarisse
ben.usenet at bsb.me.uk
Sat Nov 5 17:17:35 EDT 2016
Steve D'Aprano <steve+python at pearwood.info> writes:
> On Sun, 6 Nov 2016 04:10 am, Mr. Wrobel wrote:
>
>> Hi,
>>
>> Some skeptics asked my why there is a reason to use Python against of
>> any other "not interpreted" languages, like objective-C.
>
> Here's the "Hello World" program in Python:
>
> --- cut ---
>
> print("Hello World")
>
> --- cut ---
>
>
>
> 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;
}
? It's decades since I wrote any Objective-C (and then not much) but I
think this is the closest comparison.
--
Ben.
More information about the Python-list
mailing list