the python name

Avi Gross avigross at verizon.net
Sun Jan 6 15:09:40 EST 2019


[Can we ever change the subject line?]
{REAL SUBJECT: degrees of compilation.}
Peter wrote:

"...
Hoever, this is the Python list and one of the advantages of Python is that we don't have to compile our code. So we need a different excuse for fencing on office chairs ;-).
..."

I understand what he means, but python does sometimes do a half-compilation to byte code if the compiled version does not exist or the file being read is newer. And, if it cannot write a file, it compiles it in memory each and every time. This half-digested format may not be considered a compile down to the level of machine code, obviously.

I have no idea of relative run  times for the compiles as so much depends on the contents of files and their sizes and the underlying language/compilers. Compiling a project with an endless numbers of pieces can take a very long time. When you are just doing one file now and then, not so much. I suspect that the common method of spreading out a program into many small files can have an impact on the time it takes.

I won't share my own war stories of how to compile in what now seem primitive environments on overloaded machines where you often figured out your mistakes on paper before the compiler quit and showed you officially 😊

What is the purpose of compiling? Superficially, it is to catch serious errors. So if there are serious errors, or perhaps to put it mildly, places where the compiler can't figure out exactly what you, the programmer, meant, it often can quit early. Only when it finds nothing wrong does it need to finish to the end. Sometimes parts of what you may not necessarily consider the compiler can be done selectively or even externally.

I mean you can use tools to tune up your code in ways that search not so much for obvious errors but for potential errors or possibly poor technique that generate warnings or hints. If you add some of this functionality in the normal compile, you slow it down. Similarly, there are aspects that optimize the code in some ways that are good to have in final production code ready to ship but may not be needed every time you compile.




More information about the Python-list mailing list