Scripting languages for J2ME

One of the many limitations of J2ME is the lack of dynamic code addition on runtime. It is impossible to add new classes, be it by class files or by reflection. The required APIs are just not included in CLDC. Given this limitation I find it surprising there are not many J2ME hosted script interpreters, specially now that medium and high end handsets have megabytes of available heap memory and fast JIT compilers. Here are the ones I can find.

Imperative languages

FScript, a very simple scripting language, has a J2ME port called FScriptME.

Hecl is a full blown scripting environment for J2ME. It has specific support for J2ME APIs and includes easy to use wrappers for many of them.

The Simple Forth Interpreter has a J2ME port. Forth is a very good fit for the limited resources you find in J2ME handsets but its reverse polish notation and stack-based, hum, everything, are usually very off-putting to programmers.

Lisp dialects

An extremely simple J2ME Lisp interpreter as an OKI software programming exercise. I’m not kidding, run it and see it for yourself. It lacks proper lambda expressions so it’s not useful for anything other than as a demonstration, but it could be used as the base of a more complete interpreter (which is what part of the exercise appears to be).

JScheme is small enough to be ported to J2ME, specifically the old 1.x versions which have less bootstrapping implemented in pure Scheme (which allows for a smaller JAR file.) In fact somebody as already ported it to J2ME.