views:

304

answers:

8

Do you know of a runtime written in Java/J2ME, that is capable of reading and executing a script/binary file?

+3  A: 

Many JVM Languages - Clojure, for example. There are pretty much hundreds of JVM languages floating around, most of which were implemented in Java - Scala, Rhino, etc.

Nathaniel Flath
Where can I get a list of these "JVM" languages?
Jenko
Google is your friend here. Try search terms like 'jvm dynamic language'
ConcernedOfTunbridgeWells
+10  A: 

Wikipedia has a complete list. However, you sound like you're probably interested in Jython and JRuby.

Paul Biggar
+1 for the first sentence. Given the very rich set of languages implemented on the JVM, I can't think of any reason to single out Jython or JRuby. Groovy is just one example of a language specifically designed for the JVM that does just what the OQ asks for.
joel.neely
+1  A: 

The problem is that j2me can be too limited in its use of reflection to enable this, so you need to investigate your specific target.

In terms of java in general, there are many, such as JRuby, Beanshell, Jython, etc.

Yishai
+4  A: 

I know of an x86 emulator written in Java, JPC

jcopenha
+1  A: 

In terms of unique languages, the major ones are Clojure and Scala. Additionally, there are ports of many major languages to the JVM platform, mostly high-level languages. These include Ruby -> JRuby, Python -> Jython, and JavaScript -> Rhino. A more complete list is here.

Imagist
+3  A: 

I wrote just such a language designed to be small enough for J2ME, and to not use reflection/code generation/etc...

http://www.hecl.org

It's open source under a liberal license, so you're welcome to take it, study it, include it in your own programs, or hack it to make it behave like you want.

For 'regular' Java, there are other languages that do more and are faster and more complete.

David N. Welton
+1  A: 

This is an impressive list of programming languages for the Java virtual machine :

Programming languages for the Java Virtual Machine JVM

RealHowTo
A: 

I just listened to a Software Engineering Radio podcast where a Sun developer talked about Maxine which is a JVM that is mostly implemented in Java itself. It was a very interesting interview and technology.

So it's feasible that someday Java itself (meaning the standard JVM) will be implemented in Java much like C compilers are written in C (after a bit of bootstrapping).

Matt