What is the equivalent word for "compile" in an interpreted language? [closed]

In C, we say:

GCC compiles foo.c.

For interpreters (such as Lua), what is the equivalent verb?

The Lua interpreter ____ foo.lua.

When I write instructions for users of my Lua script, I often say:

Run the interpreter on foo.lua.

I think this can be said more succinctly:

Interpret (or Translate) foo.lua.

but that sounds awkward for some reason (perhaps because I'm unsure of its correctness). I can't really say compile because users may confuse it with the usage of the Lua compiler when I actually mean the Lua interpreter.


Solution 1:

What about:

The Lua interpreter executes foo.lua.

Or:

The Lua interpreter runs foo.lua.

Seems pretty reasonable.

Solution 2:

I would probably write

Lua interprets foo.lua

but if talking to someone not versed in my particular language, I might still use compiles as I would expect that to be broadly understood.

Solution 3:

I’m afraid that compiled does not mean what you think it means.

Almost all modern interpreted languages are compiled first. They just don’t generate native machine code to be executed by the hardware, but rather by some sort of pcode (pseudo-code) interpreter, or byte-code interpreter, or whatever makes sense for their representation.

Thus if you try to run a Perl program, the compiler will indicate syntax errors. If you don’t get any, then the interpreter is turned loose on the resulting compiled representation.

To a rough approximation, when you see “compile”, you should be thinking “parse”. And when you see “interpret”, you probably should be thinking “execute”, or perhaps even better, simply “run”.

And “code generation” is something else again.

Perl compiles and executes code. Or it parses it and runs it. So do many other languages.

Solution 4:

The intermediate step between text and effect that is "compiling" doesn't exist in an interpreter; that's the distinction that defines the difference. You can trace the boundary with Just-in-time compilation a.k.a. JIT.

Whether or not a language is "an interpreted" one started blurring decades ago and is slowly getting blurrier. It looks to me like the distinction is inconsequential here, so I'd just say

run foo.lua

and

lua runs foo.lua

Solution 5:

As jthill points out, there is no action that corresponds to compiling in an interpreted language, so in one sense, your question is meaningless. It's like asking, "What's the word for 'claws' on a goldfish?"

But okay, the correct term for what you want is "interprets". And if you think it's awkward to say, "The Lua interpreter interprets the program", then just say, "Lua interprets the program." You'd have the same issue with a compiler. Sure, you could say, "The C compiler compiles the program", but normally we just say, "C compiles the program" or "We compile the C program" or some such. If it's necessary to specify "the Lua interpreter" for some reason, then I guess you could use an alternative word that could be synonymous with "interprets", like "executes" or "processes".

I'd add that while in everyday speech it's common to choose a synonym to avoid sounding repetitious, to give the sentence a certain rhythm, etc, you should be careful about this in technical writing. Many technical terms have precise meanings, and you can't just toss in a synonym because it "flows better". Like, my dictionary says that "drift" is a synonym for "float". But I think it would be a really bad idea to say, "Declare this variable as a drift" because you've already used the word "float" twice in the sentence!