It was thus said that the Great Eric Smith once stated:
Chuck Guzis wrote:
If that's not native code, then neither is a
printf(),
I suppose the printf() interpreter has a rather usual instruction set,
which isn't even close to being Turing-complete, but if you want to call
it an interpreter rather than native code, I don't see any strong
argument to the contrary.
And using printf() does incure some significant overhead. I wrote a hex
dump program using printf() and another one using system calls. It took the
printf() version 5 seconds to dump a 16034944 byte file to /dev/null [1],
while the (final version of the) system call one took only 0.2 seconds for
the same operation [2].
And yes, printf() does interpret the format string, so yes, I consider it
an interpreter.
-spc (And thank God printf() isn't Turing complete ... )
[1]
http://boston.conman.org/2012/01/28.1
[2]
http://boston.conman.org/2012/02/01.3