▲ | TZubiri 5 days ago | |||||||||||||||||||||||||
Not to be that guy, but Python is an interpreted language. That said, I guess technically you could make something that compiles python to an executable? This is hacker news after all | ||||||||||||||||||||||||||
▲ | vidarh 5 days ago | parent | next [-] | |||||||||||||||||||||||||
A language is not inherently interpreted or compiled. Some languages are more or less easy to compile efficiently and without embedding a JIT compiler, but any language can be compiled. For Python in particular, there are already compilers. If you want a nightmarish language to compile, look at Ruby. There are compilers even for Ruby. | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
▲ | zahlman 5 days ago | parent | prev [-] | |||||||||||||||||||||||||
This isn't even correct for the one specific reference implementation you're presumably thinking of. It is just as much "compiled" as Java or C#, just that the compilation is often done on the fly. (Although IIRC C# does some additional trickery to pretend that its bytecode is "real" executable code, wrapped in a standard .exe format.) Presumably you've noticed the __pycache__ folders containing .pyc files; those are compiled bytecode. When you install Python, typically the standard library will all be precompiled (at least in part, so that those bytecode files can be created by an admin user now, and used by a standard user later). There is an interpretive REPL environment, but that works by doing the same bytecode-compilation each time. |