Scripting languages are used to chain applications together into batch
streams. Scripting languages let you invoke various Java utilities and do simple
calculations. They are also used interactively where you type a line and have it
executed immediately. Some Java-based platform independent scripting languages
have been devised such as Pnuts, FESI,
JavaScript, DynamicJava
and BeanShell.
Traditionally, scripting languages have had the ugliest syntaxes of any type of
computer language. The ugliest surely has to be Windows/DOS command line. Other
popular ones include python, Bash, TCL/TK, Awk and
Perl.
Because they are designed for one-shot command line use, the syntax of such
languages tends to be loosey goosey (i.e. slovenly) with no type checking.
Usually scripting languages are interpreted (without even being preparsed)
rather than compiled. Usually they have many platform and implementation
dependencies. Usually they are a disgusting pile of seat-of-the-pants kludges
piled on another. You might gather I don’t hold this branch of computer
science in high regard.
I suggest avoiding these traditional scripting languages altogether and using
ordinary Java instead for the same purpose. Use Jikes for compile speed. The
advantages are:
- familiarity. Only one language to learn.
- Platform independence. Write once run anywhere.
- Structured ifs, object-oriented design, methods, parameters, types, sane
variable names, threads, timers, etc. all the features that make writing complex
programs easier.
- You can use a user-friendly GUI interface, (or a command line), to get direction
from the user.
- You only have to specify each fact in only one place. Inheritance lets you build
defaults on defaults.
- Fast execution of compiled code.
- If you are running Java apps, you don’t need to load a fresh JVM for every
step. You can for example compile 1000 java programs in one go feeding them via
directly to Java’s sun.tools.javac.Main.compile
method.
- There are no artificial limits on the length of the command line, environment
size, etc.
- You can use a customiser class that implements an interface to provide input to
a program. That class can provide an arbitary amount of data, guaranteed to be
already in the internal type expected. It can provide arrays, trees files or
Collections. It can provide custom algorithms. You don’t have to invent a
way to pack all this information on the command line, parse it and validate it.
You don’t have to specify your data is some impossible to proof-read
command-line format. You just fill in the stubs of a Java class to provide the
data. It gives you infinite flexibility with no extra overhead or complexity.