Working with other languages

Groovy. Grails. Scala. When it fully implements Java 6, JNode gets all of these other programming languages for "free". For example, I'm working with Enterprise Generation Language (EGL) from IBM. While I am not recommending anyone abandon the Java programming language, I thought I might mention that other programming languages are up and running on the Java Virtual Machine. Ultimately, this has implications on the design of a command line shell. I think JNode must deals a mix of languages.

Let's say that someone volunteers to create a plug-in descriptor for the groovy application. We should be able to type the following command from a shell prompt on JNode:

$ groovy helloWorld.groovy

Notice that a .groovy script is handled by the groovy command. For complete integration, I should be able to type this:

$ ./helloWorld.groovy

The first line inside a .groovy file should be something like "#! groovy", to enable the groovy application to run any groovy script regardless of its name. Now we don't want to get into file associations, do we?

And yet, the only premise I've seen for a command is a pre-built plug-in descriptor. Where is support for a command PATH and external commands? One obvious solution is to support relative command names (look first to an alias and then to the PATH) and absolute path names. A jar might be an executable, too. To invoke the Main-Class of an executable jar, what could be simpler than this:

$ ./launcher.jar

Other languages

I'm testing several languages under JNode like JRuby, Groovy, Scala and PHP (Quercus) from time to time and I have promising results. JNode needs several improvements on various domains until those more complex languages and runtimes will be usable but the simpler languages like BSH and JavaScript (Rhino) have been part of the JNode distribution for a long time now and they are usable for various scripting purposes (see the bsh and js commands).
Python (Jython) and Scheme (Kawa) have been reported also to work here: and here:
I also tested Clojure but currently the JNode bytecode parsers and compilers cannot cope with the peculiarities of the Java bytecode generated on the fly by the Clojure runtime and so it's not working at all yet. Otherwise its small size and excellent performance will make Clojure a great language for JNode as a language of the LISP familly.
Recently there were news about a project starting up to implement a Perl variant based on the JVM. This is good news because with the so called JPerl practically all scripting languages will be availbale on JNode that are in widespread use these days.
JavaFX support will also be needed when it will be released as completely open source software.

What would really help in moving forward the support for other languages on JNode is to have contributors picking up any of those language runtimes, testing them, fixing and reporting bugs related to them and so making sure that they will work on JNode.

Integration of these languages (and others) will happen on several fronts. One of them is the shell integration for which you provided examples. Whatever provides easy usage and good integration with the shell - this actually can go far beyond of what we can see in current operating systems - is good for JNode in building a competitive edge and should be considered including your examples above.
An other type of language integration is via the API for scripting language support introduced in Java 6. This involves to ensure that a given runtime implements the SPI for this API and this implementation is available under JNode (this applies to languages also developed in the JNode project like Bjorne) and it also involves that the language runtime discovery machanism is in in place in JNode and it's functional.
An other type of language integration is related to Runtime.exec and it must ensure that scrips and executables implemented in other JVM languages can be started up via the exec() methods.
Finally JNode must also give good support for such executables in the graphical user interface which makes it easy to identify and start them up wih the start menu, with a future graphical file manager and with other startup methods the JNode desktop will support.

Yes, i completely agree. And

Yes, i completely agree. And we do have some basic support for this, although it isn't currently 'simple'. In order to run a groovy script with #!groovy as the first line, requires implementing an Interpreter. If there is a back-end library that does the actual interpreting, then this Interpreter is simply a wrapper interface that forwards the script to the library. When the script is 'executed', the interpreter for groovy would be looked up, an instance created, and the script gets handed to the interpreter.

Currently though, its not the most flexible. I'm currently playing around with awk, that uses the Jawk project for its backend. You can run it just like you would expect from the command line, passing it an awk script, or providing an inline awk script. But this doesn't allow you to write an awk script with an awk sha-bang.

I like that jar idea. I dont think a jnode user should have to type java -jar /path/to/file.jar.

We do have the means with the current shell/cli code to do this. And it would be great to see the command line this flexible.


Thank you for considering the jar idea. It's on my wish list.

Your wish list

Gchii: when you say you have a "wish list", is this because you actually use JNode?

How I use JNode

I use JNode for research. I'm running Microsoft Windows XP, then VMWare Player, then JNode. As you may remember, I've been working toward a Java-based operating system since 1997. My core strategy is practical research on Java-based operating systems. I continue to use well-packaged APIs from OS research in production applications.

I see ....

So you are using JNode! Have you considered being a JNode producer instead of just a JNode consumer? I've put this question to you many times before, in many forms, but you've never responded. Would you care to respond this time?

If you cannot help with development, could you least at least give us some links that show JNode being used in your research / production applications? We could use this as the start of a "JNode case studies" page, which would help to attract more interest in the project.