Timeline for Why isn't there a python compiler to native machine code?
Current License: CC BY-SA 3.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 18, 2015 at 18:17 | history | edited | Randall Cook | CC BY-SA 3.0 |
fixed grammar
|
Nov 8, 2014 at 10:30 | comment | added | Thomas Eding | Comparing the speed of interpreted python to compiled python is interesting in itself. Stop saying "use C++". Perhaps you already have the code written in Python. Perhaps the code is easier to write in python. Who cares. What I do care about is a 1.5x speed up (whatever it is). That can make a huge difference. | |
Jul 30, 2014 at 14:07 | comment | added | Marc Claesen | @jozefg this depends on the nature of the application and the implementation. If I were to code in C++ using Python philosophy (e.g. use lists for just about anything), the performance of my C++ program would be terrible (or, conversely, Python would be competitive). A proper static implementation may have significant performance benefits over a dynamic one, depending on the nature of the program (for IO bound programs it won't matter, for instance). Note that performance benefits need not be time: memory requirements are also much higher for dynamicly typed languages. | |
Jun 8, 2014 at 18:53 | vote | accept | user2986898 | ||
Jun 7, 2014 at 16:52 | comment | added | daniel gratzer | Well actually, you'd be surprised what sbcl can do. The benchmarks game shows it running as fast as Java, nearly as fast as GHC, and within 1x to 10x of C. It's not slow by any standards. Yes, dynamic types inhibit compilation to some extent, but not so much as you seem to think. | |
Jun 7, 2014 at 16:47 | comment | added | Euphoric | @jozefg I said effectively compile. Not just compile. Python too has it's Cython compiler which produces native code. The point is those compilers ca'nt do even fraction of optimizations that compilers for statically-typed languages can. And when you compare performance, compare it to compiled C++ and not interpreted Python. | |
Jun 7, 2014 at 16:44 | comment | added | daniel gratzer |
It's worth noting that this does make the problem hard, but not impossible. sbcl compiles Common Lisp which also is dynamic, has eval , and a bunch of other things to make compiler writers sad. It's not to the level of gcc, but it's certainly faster than CPython's interpreter.
|
|
Jun 7, 2014 at 11:03 | history | answered | Euphoric | CC BY-SA 3.0 |