[OT] difference of Scripting and programming
Paul Almquist
paul at almquist.name
Tue May 24 14:26:03 UTC 2005
> Not really. A compiled program also tells another program what to do.
> For example a compiled binary interacts with the hardware by making
> system calls that are handled by the kernel or the video driver or .....
>
> A program that makes direct hardware calls is severely frowned upon
> these days. Thus, except for the kernel and specialized hardware
> drivers, all programs, whether they be binary executables (compiled) or
> scripts (interpreted) actually interact in defined ways with other
> programs (the shell, the kernel, the compiler, the interpreter, etc).
>
Programs are constantly making direct hardware calls, that is, executing
machine language instructions (whether the source was written by the
programmer or part of a library) to accomplish some task without having to
make system calls. For example, calculating the sine of an angle or
searching a table. Direct access to shared resources (peripherals, system
clock, etc) is what is frowned upon.
Compiled programs do not _interact_ with the compiler at run time. A compiler
need not even be installed. At compile time the source code and compiler do
not _interact_, rather the compiler just acts on the statements in the source
file. The source file may contain some precompiler directives (#ifdef,
#include, etc) or compiler directives. Programming language imperative
statements are translated to machine code (or perhaps first to assembler,
then to machine language). The machine code could be an add, load register,
library call, system call, etc. Declarative statements tell the compiler to
reserve memory, initialize memory, equate addresses, etc.
--
Paul Almquist
paul at almquist.name
Eau Claire, WI USA
More information about the fedora-list
mailing list