bsh.engine.BshScriptEngine (JSR-223 javax.script support) implements Compilable, indicating to script hosts that the engine currently supports compilation. I believe that a runtime instanceof Compilable and cast is the main way of determining whether pre-compilation to a CompiledScript is supported by the current ScriptEngine.
In BeanShell 2.0b4 the ScriptEngine class bsh.engine.BshScriptEngine implements Compilable, but then goes on to:
public CompiledScript compile( Reader script ) throws
throw new Error("unimplemented");
This is unfortunate for clients with pluggable ScriptEngine-s, of which BeanShell may be one, as they can expect to be able to pre-compile scripts due to the presence of the interface, but will always receive the thrown error.
Recommend that the Compilable interface is removed until BeanShell and the BshScriptEngine support compilation.