3 ms·
> Direct interpreters (based on the AST) are slow, but dead simple. Still far too complex, and, what is worse, very convoluted. You cannot split such an interp
by sklogic 11y ago
> Direct interpreters (based on the AST) are slow, but dead simple.
Still far too complex, and, what is worse, very convoluted. You cannot split such an interpreter into series of very small and easy to understand steps, it must do everything at once, in a single huge recursive visitor. Compare it to a simple compiler which will rewrite one distinct aspect of a language at a time.
Another awful property of interpreters is that you can't strip them away from the runtime, it must be woven into all the parts of the interpreter and cannot be abstracted away. While compiler can be isolated from all the runtime issues which should be implemented separately (or simply reused).