Version 6 of the Java Platform, does not mandate any particular script engine, but it does include the Mozilla Rhino engine for the JavaScript programming language and it implements the java.script APIs, which allow you to use script engines. The interpreters for many scripting languages like Ruby, Python, JavaScript, Java, and TCL are available in internet.
The Java Scripting API is a scripting language independent framework for using script engines from Java code. With the Java Scripting API, it is possible to write customizable/extendable applications in the Java language and leave the customization scripting language choice to the end user.
Some useful characteristics of scripting languages are:
- Convenience: Most scripting languages are dynamically typed. You can usually create new variables without declaring the variable type, and you can reuse variables to store objects of different types. Also, scripting languages tend to perform many type conversions automatically, for example, converting the number 10 to the text "10" as necessary.
- Developing rapid prototypes: You can avoid the edit-compile-run cycle and just use edit-run!
- Application extension/customization: You can "externalize" parts of your application, like configuration scripts, business logic/rules and math expressions for financial applications.
- "Command line" shells for applications - Most applications have a web-based GUI configuration tool these days. But sysadmins/deployers frequently prefer command line tools. Instead of inventing ad-hoc scripting language for that purpose, a "standard" scripting language can be used.
|