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

Adam M amorawski at magna-power.com
Mon Nov 7 16:27:19 EST 2016


On Saturday, November 5, 2016 at 8:58:36 PM UTC-4, Steve D'Aprano wrote:
> On Sun, 6 Nov 2016 08:17 am, Ben Bacarisse wrote:
> 
> > Steve D'Aprano <ste... 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.


It is Objective-C. You are mistaken taking NS extensions to function names as a part of Objective-C. There are not. It is from NextStep/Sun implementation. Because they are always used a lot of people tend to think that they are part of Objective-C - but they are not - they are just libraries.



More information about the Python-list mailing list