>
> The best way to distinguish compilers from interpreters is that a 
> compiler takes a program and produces another program, whereas an 
> interpreter takes a program (along with some input) and produces an 
> answer. 
>

Doesn't this trivialize the difference a bit too much? Does it really come 
down to the time you choose to compute? I persist intermediate state - I am 
a compiler. I do the exact same thing (run off the same "compiler" 
codebase) but ask for inputs and compute - I am an interpreter.

I scratched my head a bit and came up with the following: if there is one 
to one correspondence between target and host language "blocks" (there may 
be multiple such pairs till you get to machine code) then this is an 
interpreter. If you do nasty shenanigans in the generated code in the host 
(semantics altering optimisation passes and what not) then this is a 
compiler. Latter ought to effect debugging even error reporting quite 
drastically. This is almost certainly naive and amateur of me. I'm 
desperately trying to understand why I have the impression that there ought 
to be a non-trivial difference between the two. That's been my impression 
from the literature.

I think I had this paper in mind: https://www.jilp.org/vol5/v5paper12.pdf 
oh wait p4: "we do not have a precise definition for efficient interpreter" 
... oh good. Although they do mention some justification for "compiling" to 
a VM in the following paragraphs that boils down to "avoid the overhead of 
re-parsing and re-interpreting intermediate representation". I vaguely 
recall that Lisp in Small Pieces switched to a VM when the "fast 
interpretation" was introduced.

I may have confused myself. Badly :(

I guess I would call Tcl and Picolisp interpreters and Racket and most 
Scheme implementations of note not at all.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/98a4e936-1703-4182-bb85-ce78a8694feao%40googlegroups.com.

Reply via email to