Compile time function execution (or compile-time function evaluation, CTFE) is the ability of a compiler, that would normally compile a function to machine code and execute it at run-time, to execute the function at compile-time. This is possible if the arguments to the function are known at compile time, and the function does not make any reference to or attempt to modify any global state (is a pure function).
Even if the value of only some of the arguments are known, the compiler may still be able to perform some level of compile time function execution (partial evaluation), possibly producing more optimized code than if no arguments were known.
Read more about Compile Time Function Execution: Example
Famous quotes containing the words compile, time, function and/or execution:
“If I were a maker of books I should compile a register, with comments, of different deaths. He who should teach people to die, would teach them to live.”
—Michel de Montaigne (15331592)
“But I am here,
And they are far, and time is old.
Within my dream the grass is cold;
The legs and locked; the sky is dead.”
—Mark Van Doren (18941973)
“The intension of a proposition comprises whatever the proposition entails: and it includes nothing else.... The connotation or intension of a function comprises all that attribution of this predicate to anything entails as also predicable to that thing.”
—Clarence Lewis (18831964)
“If I were asked to chose between execution and life in prison I would, of course, chose the latter. Its better to live somehow than not at all.”
—Anton Pavlovich Chekhov (18601904)