Take the 2-minute tour ×
English Language & Usage Stack Exchange is a question and answer site for linguists, etymologists, and serious English language enthusiasts. It's 100% free, no registration required.

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.

share|improve this question
1  
This should be posted to StackOverflow or Programmers.SE. –  JeffSahol May 31 '12 at 19:58
1  
You’ve asked the wrong question. –  tchrist May 31 '12 at 23:56
1  
Does an interpreter compile or run the machine code?!! I don't think so. An interpreter analyses and executes (execute and run may mean the same in programming but may mean different things in english) each LOC (line of code). In any case, i don't think you will get accurate answers here. Try at programmers.SE. Cheers!! –  Fr0zenFyr Jun 1 '12 at 4:46
1  
I disagree, because I think this is an interesting question in terms of English Usage. –  Schroedingers Cat Jun 1 '12 at 15:09
2  
I voted to close in light of the fact that OP has posted the same question on Programmers and I think that will get him a better answer. I am open to reopening if Programmers rejects his question. –  KitFox Jun 1 '12 at 15:17
add comment

closed as off topic by JeffSahol, Clark Kent, Mr. Shiny and New 安宇, Robusto, KitFox Jun 1 '12 at 15:15

Questions on English Language & Usage Stack Exchange are expected to relate to English language and usage within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

8 Answers

up vote 10 down vote accepted

What about:

The Lua interpreter executes foo.lua.

Or:

The Lua interpreter runs foo.lua.

Seems pretty reasonable.

share|improve this answer
1  
Yes - apart from being clumsy, precisely what OP wants to say (the Lua interpreter interprets foo.lua) is a pretty pointless utterance. Both yours are perfectly normal things to say. –  FumbleFingers May 31 '12 at 19:46
1  
Actually, the most generic and by that possibly the most fitting term could be 'to process'. –  Hans Dampf May 31 '12 at 20:28
    
Thanks, I went with "runs". –  user46874 Jun 1 '12 at 16:32
add comment

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.

share|improve this answer
4  
+1 for "Lua interprets foo.lua", but they're both fairly basic programming concepts, so if someone's not too familiar with interprets they're probably not familiar with compiles either. In that case, you could just say runs. –  Hugo May 31 '12 at 20:14
add comment

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.

share|improve this answer
1  
+1 for parse- interpreters parse and execute. I'm not sure that all interpreters compile to pcode though. I've written many language parsers in lex/yacc (or flex/bison) that execute the instructions immediately in the yacc grammar and never go through the step of generating pcode with a separate pcode interpreter. –  Jim Jun 1 '12 at 1:17
    
@Jim Right: the shell doesn’t compile, for example. But things like Java, Perl, Python, and Ruby all do. –  tchrist Jun 1 '12 at 1:31
    
See definitions of "compiled" and "interpreted" at, for example, publib.boulder.ibm.com/infocenter/zos/basics/index.jsp?topic=/… or en.kioskea.net/contents/langages/langages.php3. I think that pretty much by definition, if a language uses a compiler, it is not an "interpreted language". Java, Python, and others are often called "semi-interpreted" or "compiled/interpreted" (or as in my second reference there, "intermediary"). –  Jay Jun 1 '12 at 14:06
add comment

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
share|improve this answer
add comment

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!

share|improve this answer
2  
I’m sorry to say this, and I do not mean to be rude, but this statement is nonsense: “ there is no action that corresponds to compiling in an interpreted language”. –  tchrist Jun 1 '12 at 0:14
1  
@tchrist "Compiling" is translating from a human-readable version of a program to machine code. For example, you put a ".cc" in and get a ".exe" out. With interpreted languages, you never have an ".exe" file, there is no such translation process. So what would you consider the "corresponding process"? –  Jay Jun 1 '12 at 13:29
    
Um no, strictly speaking, that is incorrect. Compiling does not mean “generates machine code”. Rather, a compiler is “a program that munches up another program and spits out yet another file containing the program in a "more executable" form”. I assure you that if you take a compiler class in grad school — have you? — you will be made quite aware of the difference between compilation and code generation. –  tchrist Jun 1 '12 at 23:57
    
Yes, yes, my wording was imprecise. Today it is common to talk about "compiling to byte code". But that doesn't change my point: there's still no equivalent step in an interpreted language. (Unless you want to call a semi-interpreted language like Java an "interpreted language", but if you're going to nit-pick by description of what a compiler does, I'm sure you would never engage in any such imprecise terminology. :-) –  Jay Jun 4 '12 at 17:09
    
And no, like Grace Hopper, I've never taken a compiler class. If you want to discuss credentials, I suppose I could mention my 32 years in the field, list the clients for whom I have done consulting work, titles of books and articles on IT that I have published, etc. But that would be boring. :-) –  Jay Jun 4 '12 at 17:16
show 5 more comments

The interpreter interprets the code, though I understand why you don't want to write that. Other words you can use are evaluate or execute. (I'm pretty sure that we used evaluate in Common LISP, but it's been a while.)

share|improve this answer
add comment

If it is a true interpreter, that is, it reads the code as you have written it, and runs it directly form that, then it would be appropriate to say "the Lua Interpreter runs foo.lua" - because that is all it is doing, running a file of instructions. Exactly like the OS runs a .exe file as an output of a compilation.

If it is in fact pre-compiling it, or suchlike ( as might be suggested by the fact that there is a compiler too, although I am not at all familiar with the Lua language ), then either compiling or processing would be appropriate.

Using Interpret or Translate could be confusing, even though correct, because they are too specific - too detailed in terms of what is going on for the context. Especially in the former case, run is the usual word for taking a file and doing what it says. It actually doesn't matter how that process is done.

share|improve this answer
    
You're the only one to comment on Interpret and Translate. Thanks. –  user46874 Jun 1 '12 at 16:33
add comment

Programmers' common way of saying it can be

Run the script

or

Now run foo.lua and see what the result is

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.