This is the mail archive of the
rhug-rhats@sources.redhat.com
mailing list for the RHUG project.
javascript + gcj
- To: "Java at Gcc dot Gnu. Org" <java at gcc dot gnu dot org>, <rhug-rhats at sources dot redhat dot com>
- Subject: javascript + gcj
- From: "Anthony Green" <green at redhat dot com>
- Date: Sat, 6 Oct 2001 17:32:58 -0700
FYI... I've just imported the Netscape/Mozilla javascript package (rhino) into
rhug.
In addition to the main library, lib-org-mozilla.so, it will install two
programs...
js - a javascript shell
jsc - a javscript compiler for generating .class files (compilable with
gcj)
javascript is actually kind of cool. It looks quite practical as a general
scripting language because the gcj runtime loads relatively quickly. Here's a
javascript version of libjava/scripts/showval.java, for instance..
---- cut here -----------------------------------------
#!/usr/local/bin/js
ch = arguments[0].lastIndexOf ('.');
className = arguments[0].substring (0, ch);
constName = arguments[0].substring (ch + 1);
klass = java.lang.Class.forName (className);
field = klass.getField (constName);
print (constName + " = " + field.getInt (null));
---- cut here -----------------------------------------
AG