34

The CLR under .NET is referred to as the "Common Language Runtime." It seems that the convention is "runtime" for a noun and "run-time" for the adjective. Is this correct or should it be "runtime" also? I'm inclined to think it should be like the following:

  1. The variable is typed at runtime.
  2. The runtime variable is null.
5

6 Answers 6

22

I (as a programmer and linguist) would pretty much always use runtime.

I think you might be building too much into the idea that runtime is an 'adjective' in compounds such as runtime environment. The word still remains more noun-like than adjective-like[*] in such cases and there's little motivation for inventing a special spelling in that case. And if you look at examples of actual articles, textbooks etc, I think you'll find most authors come to the same conclusion.

In the Java and C# APIs, I also don't think you'll find a case of it being spelt "RunTime" rather than "Runtime".

[*] cf. "more flexible environment"~"*more runtime environment"; "this environment is flexible"~"*this environment is runtime" etc. These aren't perfect tests, because "adjective" vs "noun" don't really constitute a perfect dichotomy. But you can see that "runtime" is more at the 'nouny' than the 'adjectivy' end of the scale in these cases.

7
  • I think the "more ______" test is creative, but I don't know if "more-nouny" captures the concept. "Semi-annual" is clearly an adjective. The fact that we don't say "more semi-annual" doesn't make it "more-nouny"; I think it just puts "semi-annual" (and "run-time" and the like) into a category called "non-comparable".
    – Dan H
    Commented May 7, 2012 at 17:18
  • No, it's not a perfect test, and that's one of the reasons why I say the "noun"~"adjective" dichotomy is not perfect. And if it was the only test, you'd probably end up with a categorisation more like the one you suggest. However, in this instance, if you have to shoehorn the word 'runtime' into one of the two categories, on balance (for the reasons mentioned here plus various others) it fits better into the category of "noun". Commented May 7, 2012 at 17:27
  • P.S. I think the presence of the hyphen in "semi-annual" is a red herring, though (or at least, a different use of the hyphen), in case that was what was influencing you to want to include it in "run-time". Commented May 7, 2012 at 17:29
  • I like Neil's explanation of it being a compounded noun, but it does raise the interesting question of when does a word cross over to being an adjective. I remember when I was learning Norwegian that compounded nouns were very common, and runtime has the feel of a Germanic compounding. Maybe this is one of those cases where our linguistic roots are rising up to challenge us again. Thanks!
    – John Dahle
    Commented May 7, 2012 at 22:06
  • You're not covering all uses of the term. You're discussing only its use within compound nouns, not its use as a standalone compound noun, e.g. in at runtime or in the .NET runtime. Commented Dec 3, 2014 at 13:16
35

This is not really an answer because I'm also lost but I'd like to point out something that seems to be overlooked in these three ways to write "runtime", "run time" or "run-time".

I would risk saying that all three mean different things, that I believe should be applied in different cases:

  • run time: this is how much time your program took to execute. If, on unix, you run time program, you get as output the program's run time (or its execution time). It doesn't sound right to me to refer to this as the program's runtime or run-time.

  • run-time: this is something that happens during a program's execution, in contrast with load-time (when it is loaded) or compile-time (when it is being compiled). Note that like "run time", I venture that "compile time" is the time it takes to compile, and compile-time is something that happens during a program's compilation (such as compile-time optimizations --- note again that "compile time optimizations" would also be valid if I was referring to optimizations that shorten the time an application takes to be compiled, not optimizations to the application itself).

  • runtime: this is what something is (e.g. "the Java runtime"). Again, it does not seem correct to me to say something like "My program is executed by the Java run time".

Does it really make sense to join all these uses together under one word? It seems to me that their distinction is useful.

1
  • 2
    I think you could improve this by writing not that there are three ways to write it, but multiple ways in which the term is used that may require different ways of writing it: 1) as a compound noun meaning 'the time it takes to run'; 2) in the expression 'at run time' meaning 'when running'; 3) as an attributive noun: 'run-time X' meaning 'X at run time'; 4) as the contracted noun 'runtime', a shorthand for 'runtime environment'. Incidentally: I've been doing IT since 1982 and I have yet to meet the first instance of the first use. The term I know for time it takes to run is 'running time'. Commented Dec 3, 2014 at 13:27
8

The OED gives:

run time n. Computing the time at or during which a program or other task runs (often contrasted to the time at or during which a program is compiled); the length of time taken by the execution of a program or task.

  • 1964 Math. Computation 18 486 Separate run-time indications assured us > that we did not have overflow.
  • 1972 Nucl. Physics B. 48 123 Every model can in principle be simulated by every simulation method for a sufficiently long run time of a computer.
  • 1982 InfoWorld 14 June 77/2 Prompting for data entry during run time.
  • 2002 CGI Nov. 56/2 Their program can quickly recompile the programs at run-time according to whichever graphics capabilities are available.

But you really have to check what your publisher’s preferences are. The O’Reilly house style guide uses runtime with neither space nor hyphen as both a noun and adjective. However, when it comes to compiling, they use compile-time as the adjective and compile time with a space as the noun.

This presents problems of parallism failure, however, so in the Fourth Edition of Programming Perl, I’m a bit more flexible than that (pace their in-house proofreaders). For example:

  • The following are all equivalent to one another, though the first two compute the symbol table entry at compile time, while the last two do so at run time: ...
  • As you see, with RE2, the run time no longer grows proportionately to the input size, but only to the regex size.
  • That’s a handy idiom to know anyway—assigning a sub {} to a typeglob is the way to give a name to an anonymous subroutine at run time.
  • use charnames (); # no compile-time \N{}, just run-time functions
  • A dynamic scope also extends to the end of the innermost enclosing block, but in this case, “enclosing” is defined dynamically at runtime rather than textually at compile time.

As you see, sometimes I won against the in-house proofreaders, and alas, sometimes I didn’t. :( Runtime looks cleaner, but it doesn’t work well when you intermix compile time and compile-time, and you certainly aren’t going to get away with *compiletime.

Of course, when run time means the running time of a program, that’s something quite different from a runtime library and such.

3
  • A major flaw with the OED entry as I see it is that it doesn't separate out adequately the two different senses of "runtime"/"run time". When referring to an actual measured execution time of a run, it would tend to be written separately, but otherwise as a single word "runtime". Commented May 7, 2012 at 20:13
  • P.S. I don't see that it matters that "runtime" is written as a single word whereas "compile time" isn't. Obviously, "compile time" is a longer form, plus, unlike "runtime", it tends to refer more literally to "the time of compiling" rather than a set of libraries/environment. Commented May 7, 2012 at 20:17
  • I wonder if it's just a coincidence that OED looks like QED :) Commented May 10, 2016 at 9:40
1

The phrase originated as"run time" -- the time it took for an execution cycle "run" of a computer program or other event.

Over time it began being applied as an adjective in computer science, and thus became hyphenated, like: "run-time system" or "run-time execution".

As the word became more and more commonly used in computer science, folks started dropping the hyphen and now you'll usually just see "runtime". But it's not universal ... my browser spellchecker still thinks that's a typo :)

This NGram shows the relative usage of "run-time" and "runtime", illustrating the change in popularity in recent years.

To address Neil's comment below, consider this definition of runtime library from Wikipedia:

a runtime library is a special program library used by a compiler, to implement functions built into a programming language, during the execution (runtime) of a computer program.

And also consider the definition of execution/runtime:

run time, run-time, runtime, or execution time is the time during which a program is running (executing), in contrast to other phases of a program's lifecycle such as compile time, link time, load time, etc.

3
  • Lynn -- I'm suspicious that this would be the origin of this use of runtime. I don't think it's got anything to do with execution time (in terms of 'time'='measurement'), but simply that it refers to the necessary environment at the time (='on the occasion of', not to do with actual measurement) of 'running' (as opposed to compiling) the program. Commented May 7, 2012 at 17:31
  • @NeilCoffey - I have expanded my answer a bit. It's not about the duration per se (like, the measurement of 5 seconds) but the /time period/ that the program was running.
    – Lynn
    Commented May 7, 2012 at 17:59
  • +1 to Lynn for using Ngrams in Google for describing the historical usage. I hadn't thought about that!
    – John Dahle
    Commented May 15, 2012 at 13:21
0

Runtime, as far as I know, is a noun. If you see it used as an adjective, it's an attributive noun. Based on its derivation, it's likely that "run-time" is used by someone who is not aware that "runtime" is an accepted word. Or they are writing in steampunk style.

1
0

Whenever I refer to the time a programn takes for execution (= measurement of time), I spell it run time rather than runtime. If, however, I want to stress the program's status of being running, I call it runtime, e.g. in a phrase like "... variables are determined at runtime".

I cannot tell why I do it this way round, one certainly could reason for the opposite, but I would always opt for different spellings rather than one because they indicate different meanings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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