Appendix A. Introduction to BeanShell

 

We use BeanShell throughout this book to remove the fine-grained details and focus on the high-level steps of an algorithm. The BeanShell scripts that we provide throughout the book present an overview of the algorithms. In addition, they facilitate quick experimentation and interactive learning. We found a lot of value, and had a lot of fun, while using the BeanShell scripts. We tested many ideas involving the topics that we developed in the course of writing the book, so we believe that you’ll also appreciate the value of BeanShell once you become accustomed to it. So what’s this BeanShell thing anyway?

A.1. What is BeanShell?

BeanShell is a lightweight scripting language that’s compatible with the Java language. In fact, BeanShell dynamically executes standard Java syntax and extends it with common scripting conveniences such as loose types, commands, and method closures like those in Perl and JavaScript. It was written by Pat Niemeyer, and you can find its implementation in the open source project aptly called BeanShell (http://www.beanshell.org).

There’s been an effort to standardize the scripting language and incorporate it in a future JDK. As the Java Specification Request 274 states:

A.2. Why use BeanShell?

A.3. Running BeanShell

A.4. References