ANSWERS: 2
  • Scripting Language Features A language which has most (or even many) of these features will generally "feel like" a scripting language. A language which has few (or none) of them will feel like a general purpose language. Interpreter. An interpreter makes it fast and easy to run a program. Just type "perl foo.pl" and off it goes. Compare this to the typical compiler scenario. First, you have to compile everything: "gcc -g -O -Wall -c foo.c" (repeat for each module). Then link the program: "gcc -o foo foo.o ... -l...". And finally, run it: "foo". Native Complex Types. Scripting languages tend to provide native string, list, and dictionary (aka hash or a-list) types. These types can be implemented in pretty much any language - the point here is that scripting languages provide good native implementations. You should be able to create a string, list, or dictionary with a minimum of extra syntax. For example, "(1, 2, 3)" creates a list (note: no explicit function calls). You should also be able to concatenate two strings or two lists with a builtin operator (again, with no explicit function calls). Garbage Collection. Garbage collection relieves the programmer of the duty of keeping track of which objects need to be freed. It also makes memory leaks less likely (certain types of memory leaks anyway; and to be fair, it creates the potential for some nasty new kinds of memory leaks). This table lists four general purpose languages on the left (C, C++, Java, Common Lisp) and two scripting languages on the right (Tcl, Perl). The rows are the features described above, and the table entries are "yes" or "no", indicating whether each language has that feature. As you'd expect, the scripting languages have lots of "yes"es, the general purpose languages have lots of "no"s. http://www.foolabs.com/rantsnat/scriptlang.html http://www.mvps.org/scripting/languages/ http://www.w3.org/TR/REC-html40/interact/scripts.html
  • While Alatea's answer is correct, this is a simpler summary. A scripting language is a vocabulary and syntax for giving instructions to a computer, just like a programming language. The differences between the two are largely aesthetic, to the point that people often differ on whether a particular language is a programming language or a scripting language (Perl is an excellent example). Scripting languages tend to be "lighter" (easier to use, at the cost of memory), and are in many cases specialized for a particular purpose. As is noted in Alatea's answer, scripting languages are very often interpreted--translated into machine code while running--as opposed to compiled--turned into an executable once, which can then be run more quickly. That feature makes it easier or unnecessary to port scripts to new systems, but again, at a great efficiency cost. An example which is definitely a programming language is C. C can be difficult to learn, but it is highly efficient and still a standard for any application where memory usage is key. It also allows a very fine degree of control. Programs in C must be compiled before being run. An example which is definitely a scripting language is bash (intentionally uncapitalized). Bash is a shell (command line user interface) for Linux, but besides allowing the user to enter individual commands and have them executed, it will read a file full of commands and execute them all at once. That file is called a bash script or shell script, and is interpreted by bash every time it is read. The standard vocabulary is very small, consisting mostly of basic programming functions (loops, branches, variables, etc.) but because each line is a shell command, they can include references to any program installed on the system. Perl is a gray area because it contains aspects of both scripting and programming languages. It's full-featured, and expandable to make that even more so. It's also possible to compile Perl programs, but they're more typically interpreted. The purpose of Perl also comes into play--it's used both for very light utilities, much in the same way as bash, but at the same time, it's extremely popular for programming websites. In short, don't let anyone tell you there's one right answer. Expect to argue about it no matter which word you use!

Copyright 2023, Wired Ivy, LLC

Answerbag | Terms of Service | Privacy Policy