4 ms·
> Python is not usually considered a compiler, even though it writes .pyc files to disk, because its output is bytecode that only Python itself is expected to u
by bretthoerner 10y ago
> Python is not usually considered a compiler, even though it writes .pyc files to disk, because its output is bytecode that only Python itself is expected to understand.
I'd disagree, simply because this is exactly what javac does too.
- z92 10y agoBut javac doesn't run it. It's run by "java". Therefore javac is called the compiler. If things were such that "java" runs all .java files and creates those .class files as bytecode cache, then java won't have been called a compiler. And similarly, if python had two different programs, one to create *.pyc files and the other runs it, the former one would have been called a python compiler.
- haberman 10y agoJava bytecode is standardized. So any JVM implementing the spec should be able to interpret the output of javac: http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-6.html#jvms-6.2 http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-6.htm... Python bytecode on the other hand is not standardized: its bytecode is considered an implementation detail of CPython and can vary from version to version. Your example reinforces my point.