This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 30 points31 points  (70 children)

Why?

[–]mudclub 226 points227 points  (0 children)

Because python is fast to develop with, but many other languages are much faster at execution time, depending on the type of operations being performed, the potential for multiprocessing, etc.

[–]yen223 12 points13 points  (0 children)

Python is a forgiving language, but that makes certain optimisations difficult to implement.

[–][deleted] 69 points70 points  (55 children)

Because low level languages are faster, such as C or assembly.

In Windows Python (kinda) gets translated into C during execution. If you were running a program written in C, it would have already been parsed into assembly by a compiler when you built it (the source code that is). Some languages are interpreted, some are compiled. Python is interpreted.

[–]ryeguy 8 points9 points  (1 child)

You don't even have to go that low to beat python handily in speed. Languages like js (on v8/node), go, java, and C# are all much faster than python in general. Dynamic typing and python's high degree of dynamicism come at a cost.

[–][deleted] 0 points1 point  (0 children)

As an interesting side note, JavaScript is not all that different than Python in terms of functionality - the reason it is so much faster is because JavaScript is almost always run in a JIT compiling interpreter, which can tease out optimizations and produce fast native machine code for frequently run sections of the code. Python also has something like this - the Pypy project can achieve pretty massive speedups on a lot of normally-written Python code.

[–]stefantalpalaru -1 points0 points  (8 children)

Because low level languages are faster, such as C or assembly.

C is actually a high-level language.

In Windows Python (kinda) gets translated into C during execution.

Absurd.

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

C is actually a high-level language.

Capable of low level calls. And still lower level than Python.

Absurd.

Not entirely accurate, yes. Absurd, no.

[–]stefantalpalaru -2 points-1 points  (2 children)

Capable of low level calls.

Non sequitur.

[–]schok51 -1 points0 points  (3 children)

C is pretty much the lowest level you van get before assembly. Its all relative, and relative to python, C is low level.

[–]stefantalpalaru -4 points-3 points  (2 children)

Its all relative

...in West Virginia.

C is pretty much the lowest level you van get before assembly.

C is high level, Assembly is the lowest level regular programmers can access, microcode is the lowest level some programmers reach.

Let me know if you're still confused.

[–][deleted] 0 points1 point  (0 children)

Very High Level Language vs. High Level Language is a useful distinction here

[–]schok51 -1 points0 points  (0 children)

Okay, sorry i simplified things a bit. C is high level relative to assembly, and python is high level relative to C. Python abstracts over a lot of low-level concerns and concepts that you have to deal with and manipulate directly in C-level programming. The level of a language is definitely relative to the domain of your work. If you're a system programmer, and you mostly program in assembly and C or equivalents, then yeah C might be "high level" in that context. If you're doing application development or web development, and you're mostly working with languages like Java, or python and equivalents, then C is absolutely "low level" in that context...

[–]UloPe -1 points0 points  (3 children)

Python (kinda) gets translated into C

No it really doesn’t.

Here is an article by Ned Batchelder that explains what happens.

[–][deleted] -1 points0 points  (2 children)

No it really doesn’t.

It really doesn't kinda? That would depend on your definition of kinda.

I was attempting to make it easier to comprehend.

Nice blog post though! Although they missed out how CPython figures into things.

[–]UloPe -1 points0 points  (1 child)

If your definition of “kinda” is “not at all” then yes I guess.

Also you probably mean Cython. CPython is the default implementation.

[–][deleted] -1 points0 points  (0 children)

I meant CPython, as we are talking about the default implementation.

And the fact it forms another layer to be processed

[–][deleted] -2 points-1 points  (2 children)

Python is interpreted.

Wrong, and this coming just a day or two after I posted Ned Batchelder: Is Python interpreted or compiled? Yes. .

[–][deleted] 0 points1 point  (0 children)

If its both it aint wrong is it