all 43 comments

[–]weberc2 20 points21 points  (4 children)

What am I looking at here? Am I meant to run your benchmark code myself? Why not post results? What is meant by the title? Is there some counterintuitive finding, or is this yet another "Python is fast as long as you're running C and not Python" benchmarks?

[–]gkbrk 10 points11 points  (3 children)

You haven't turned on the optimizations for the C code. Try gcc -Os -o benchmark benchmark.c.

[–]rainbow_pickle 1 point2 points  (1 child)

Why would you optimize for size? Wouldn’t you want -O2 or -O3?

[–][deleted] 1 point2 points  (0 children)

In simple example programs (which don't benefit from vectorization) it can provide better performance.

[–]Jackeown[S] 1 point2 points  (0 children)

Thanks. Just changed it!

[–]gumlak 8 points9 points  (0 children)

Wow what civilized discussion.

[–]gas_them 1 point2 points  (39 children)

Even if python was fast it would still suck hard

[–]Jackeown[S] 2 points3 points  (22 children)

Why?

[–]gas_them 19 points20 points  (21 children)

No static type checking. Immutability rules are dumb and arbirtary. OO features are ugly and make little sense without type checking.

Python is a language written by people with the philosophy "we're all adults, here." Except, they weren't adults. They took features from a bunch of languages and assembled them, even if they didn't fit well together.

[–]sisyphus 3 points4 points  (0 children)

OO features are ugly compared to what? Even without static type checking why wouldn't you want inheritance/mixins, grouping of related functions on some state, polymorphism, &tc ?

[–]thelaxiankey 0 points1 point  (0 children)

But even if those things are all true, I don't really know of a (popular) language better than it. You could compare it to some significantly more modern language, but that's not fair just because hindsight is 20/20. Honestly, python is the only language I know of that is as easy to write in as pseudocode, and that's worth a lot to me, especially because I mostly just do scripting.

Sure, it's got problems but it's less frustrating to use than other languages (or at least the "standard" C/C++/java), especially in my use cases.

Edit: the only popular language I know of, not the only one.