The only definition I could personally come up with for "scripting language" that C doesn't meet is "a language where a single line of code is interpreted and executed immediately". However, Perl also does not meet this definition (for that matter, neither does Python, Java, VB, or C#). AFAIK, the only true scripting languages left in common use are *nix shell scripts and the equivilents for other OSes (DOS batch scripts, etc.). Perhaps JavaScript, but I haven't dug into much JavaScript, so I don't know for sure. Intrestingly, you could might be able to fit ASM under this definition (since there is (usually) a 1:1 corrspondance between the ASM and the raw machine code).
Defining it as "a simplistic language" might work, but that statement is so vague as to be useless as a working definition. With the right definition of "simple", you could still probably fit ASM in as a "scripting language".
"Dynamically-typed language" might work as a definition, but I doubt you could get most programmers to go along with it. You could still probably sneak ASM in there (since you'd be manipulating the memory at a low-level, you can make it any "type" that you want). For that matter, you could probably program a few libraries to come up with a dynamically-typed version of C (in fact, I know you can, since perl itself does exactly that).
How about "a language which can be compiled directly to machine code without an intermediary interpreter"? This is talking about the details of how the language is implemented, not with how the programmer actually uses the language. Ways exist to compile Perl without an interpeter (they might even work someday :). Ways exist to run C code through an interpreter (often used to shorten the debug cycle). Would machine code suddenly become a "scripting language" just because you ran it on an emulator instead of the actual CPU? VB can be both intrepreted or compiled. So is VB a scripting language or not?
Can anybody come up with a more useful definition?
---- I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer
Note: All code is untested, unless otherwise stated
|