Word Meaning – Does a Code Snippet Compile or Get Compiled?

definitionsemantic-rolessentence-meaningword-meaning

I was completely surprised that the following snippet compiled and worked in both Visual Studio 2008 and G++ 4.4.

The following code does not compile:

By coding rigidly to the spec, you can be certain that your code will compile and run without modification on any system with a compliant C++ compiler.

Those are excerpts from Stack Overflow. I've been noticing this pattern and I was wondering if it's semantically correct.

What I assume to be correct are expressions like "is/was/has/been compiled", "gets compiled". I rarely see them, though.

It gets compiled and runs but the output is…

I need my code to do different things based on the operating system on which it gets compiled.

The definition of compile doesn't back up the sentences I mentioned first.

  • to change the language in which a computer program is written into instructions that a computer can use

  • convert into a machine code or lower-level form in which the program can be executed.

To me, a code snippet can be compiled (by a compiler), but it can't compile. What would it mean?

Best Answer

Both usages are now valid.

It is possible for a verb to develop meanings and, in particular, it can develop an intransitive sense from a transitive one. If you went back and talked to people in the 1940s, then "compile" didn't have anything to do with electronic computers. It just meant "assemble information"

In the 1950s and 60s the meaning "convert source to machine code" and was used transitively. More recently an intransitive form has developed, meaning "to be successfully converted to machine code"(wiktionary sense 4). In this sense it is still more like computer jargon.

This type of verb is called an ergative verb. When used transitively it has an active meaning. When used intransitively it has a passive meaning.

For example "Bend" is another ergative verb:

I bent the iron bar.

The iron bar bent.

You should compare the intransitive form with the passive, which has an implied but unspecified actor.

The iron bar was bent (by someone).

Similarly there is a difference in meaning:

This code compiles = It can be converted to machine form

This code was compiled = Someone converted this code to machine form (the passive form has an implied but unspecificed actor)

Related Topic