2 ms·
> In a compiler, it might dynamically recompile a dispatch function You're talking about JIT compilation ("dynamically recompile"). Obviously JIT compilation
by haberman 16y ago
> In a compiler, it might dynamically recompile a dispatch function
You're talking about JIT compilation ("dynamically recompile"). Obviously JIT compilation can be a huge win for dynamic language -- no one disputes this, especially in the face of successes like V8 and LuaJIT.
However the subject of this article is an ahead-of-time compiler for Python, and I specifically was disputing whether ahead-of-time compilation for a language like Python would buy you much.
> There is a large implementation difference between an interpreter and a compiler.
The issue is not as black and white as you make it out to be. Most dynamic language interpreters do not interpret a parse tree directly; they compile first to some kind of byte code (perhaps performing optimizations in the process, just like a compiler would). For example, here is source code from CPython that performs AST->bytecode transformations and optimizations. So is CPython a compiler or an interpreter?
http://hg.python.org/cpython/file/80e71592b114/Python/compile.c http://hg.python.org/cpython/file/80e71592b114/Python/compil...
http://hg.python.org/cpython/file/80e71592b114/Python/peephole.c http://hg.python.org/cpython/file/80e71592b114/Python/peepho...
Machine code isn't that different than byte code in concept -- it just happens to be runnable by a physical machine rather than a virtual one.