3 ms·
For me, the compiler takes input program in language A and spits out the same program in language B. An interpreter goes (more or less) line by line and execute
by yoz-y 10y ago
For me, the compiler takes input program in language A and spits out the same program in language B. An interpreter goes (more or less) line by line and executes what it reads.
In theory, compilation is reversible, execution is not.
- nv-vn 10y agoMinor nit-pick: an interpreter need not work line-by-line, but rather (more commonly?) AST-node-by-AST-node. This isn't necessarily true for BASIC interpreters or something resembling assembly, but in general the code is represented as a tree of parsed values by the time the interpreter starts running your code.