Hello, do anyone know some C or C++ interpreter for cell phones? I have Nokia 5310 and found some Basic interpreter (CellBasic) and want to develop in C or C++ on the go. Or, does anybody knows Scheme J2ME intepreter?
j2me is notoriously slow. I can only shiver when thinking how slow it would get if it had to interpret another language. ;^)
You don't want to do a C interpreter in J2ME unless you first compile it to bytecode elsewhere: you'd waste a lot of space with the parser.
If you're interested, I have my own interpreter that's used by various people and companies called Hecl, at http://www.hecl.org
It's fairly simple, but has commands to access a variety of things, and is under active development, with a nice user community.
A lot of Symbian uses JIT. Most of Sony Ericsson devices uses AOT. Lots of Nokia S40 devices uses Jazelle. JIT, AOT and Jazzele have some advantages and disadvantages but I'm sure that they're much faster than plain interpreter (like Nokia 3120's JVM).
However, there is one performance issue. There are several ways to run code in Java, e.g.:
- interpreter (it can use AST)
- generating bytecode + special ClassLoader
- generating bytecode and creating special jarfile
- using JNI
Way no 1 is possible but slow.
Way no 3 can be fast but it can be really uncomfortable and difficult to implement without library like BCEL or ASM. (I can imaginate comfortable implementation running on Sony Ericsson Java Plarform 8.5+ devices that offers to install generated app and then launches the app. Note that JP 8.5 currently support two phones: Yari and Aino.)
Ways no 2 and 4 are not feasible with J2ME CLDC.