From: Peter C. <cen...@ri...> - 2002-11-03 20:46:13
|
I just took another look at BeanShell, a java-like scripting environment very similar to DynamicJava. The website is here: <http://www.beanshell.org/> BeanShell has recently added a few features which would be of interest to us for DrJava. In particular, there is a new "Strict Java" mode, which forces all variable declarations to be typed and all script statements to have Java-legal syntax. If I remember correctly, this feature has already been requested for consistency reasons for teaching in DrJava. In normal mode, BeanShell will use DJ-style loose typing, as well as automatic boxing and unboxing of primitives and an enhanced print (i.e. System.out) mechanism. Another feature that would be handy for newbies is a "global import" statement: "import *" which maps out the entire classpath. Ambiguities in naming caused by the global import will be reported at runtime and can be corrected with (an) additional import statement(s). This is coupled with a "which" command that prints the exact filesystem location of any known Java identifier. Considering the amount of difficulty that new students have in understanding the classpath rules, this could be extremely helpful. BeanShell already ships with a Swing-based console which integrates via I/O Streams or a custom interface, complete with history completion. We could also use a lower level of integration with the engine if we chose, a la DynamicJava. Everything is LGPL, so we'd have full access to the code and it would be compatible with our license. The last advantage would be consistency with other similar tools. The Emacs JDE already integrates with BeanShell, and Sun is planning to use it in a future version of Forte and the NetBeans IDE. As far as I can tell, DynamicJava is a strict subset of BeanShell, so there's little reason to hold out with an unpopular technology. Obviously this would take a significant amount of work, but I think it would be a worthwhile venture. What opinions are there from the other developers? -- Peter |