BeanShell

from Wikipedia, the free encyclopedia

BeanShell is a dynamic scripting language for the Java - VM by Pat Niemeyer . It allows virtually unchanged Java code to be executed by an interpreter . As with Python or Perl , the code is translated into an Abstract Syntax Tree (AST) beforehand . BeanShell is often used as a language for macros , for example in the text editor jEdit , in Apache JMeter and in Apache ANT .

In addition to classic Java syntax , BeanShell offers some of the simplifications typical of scripting languages ​​such as dynamic typing instead of static typing , global variables and functions , (limited) reflexive access to the program itself and the like. The syntax is very similar to that of the original Java, which makes it easy for Java programmers to switch between the two languages ​​or to translate. Since BeanShell is able to inherit from existing Java classes or to implement any interfaces , it can be used well together with existing frameworks and applications.

BeanShell extends the Java syntax especially in the following two points, whereby a higher productivity is to be achieved.

  • Methods (functions) can themselves contain methods and raise themselves as closure via the return of thisto the object .
  • Another special feature is the prototype- based object orientation that is available in addition to the class-based one .

The code was transferred to the Apache Foundation, but did not reach project status there.

From version 2.0b6 on February 5, 2016, no version was released. However, the language is stable. So far, BeanShell supports only a few of the syntactic innovations in Java 1.5.

A spin-off with the name BeanShell2 took place in May 2007 on Google Code . The project has released a number of fixes and improvements to BeanShell. There are efforts to bring the two versions together again.

The scripting languages Groovy , Jacl for Tcl , Rhino for JavaScript , Jython for Python and JRuby for Ruby follow similar approaches as BeanShell .

Web links