Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - azazad

Pages: [1]
1
TI-Nspire / Nspire Java
« on: August 18, 2012, 12:44:09 am »
I have seen the other topics on Java for Nspire, and they all seem to be dead. So I will create a new one to keep the idea alive  :)

I hope the following will encourage greater interest in the idea of Java for the Nspire, and possibly lead to this idea becoming a reality. I have had some experience using Java ME for Lego robotics, and I am somewhat surprised that something similar is not available for the Nspire yet. The Nspire is the first TI calculator that can support a JVM with reasonable resources to spare, so why not?


Can the Nspire handle it?

A JVM (Java Virtual Machine) implementation called Lejos has been available for the Lego Mindstorms NXT robotic brick for years already: http://lejos.sourceforge.net/. I will use the Lego NXT as a basis for comparison with the Nspire.

The NXT's specs compared to the original Nspire non-CAS:
NXTNspire
Processor:ARM7 @ 48MHzARM9 eq. @ ~150MHz
RAM:64kB16MB
Flash ROM:256kB20MB

The Lejos project chose to implement Java ME instead of SE for obvious reasons. Java ME is probably the most we can hope for.

Minimum system requirements for Java ME:
RAM:8MB
ROM:5MB
(from http://www.oracle.com/technetwork/java/embedded/resources/me-embeddocs/index.html)

Note that these specs are for Linux. The Nspire's simpler OS should leave even more room to spare. Can the Nspire handle Java ME? I think so.


Is it practical on a time/effort basis?

Sure. The Lejos team did it for a much more limited platform, and did it well. Their implementation has garbage collection, threading, exception handling, synchronization, and many of the other features expected out of Java. Much of the core Lejos JVM and classloader can be reused for the Nspire. The LCD and input classes can be customized for the Nspire's hardware. (Color support on the CX)


Why Java? Isn't Lua enough?

Java's performance will definitely be better, possibly much better:
  • Lua is dynamically typed, while Java is statically typed
  • Lua programs must be parsed into tokens/bytecode before execution, Java programs are precompiled into bytecode ready for execution
  • Nspire Lua interpreter was written by TI (automatic performance hit! :D)

Even without Jazelle or JIT, Java should be fast enough for most purposes.

Lua is more of a scripting language, while Java is more of an application language. Lua is easier for beginners to pick up, while Java is a more efficient language for experienced programmers. Plus, more people should be familiar with Java, since it is more likely to be taught in CS courses and has a more C-like syntax.


There will be no shortage of Java programs that can be ported to the Nspire (excluding you-know-what ;) ). Thousands of MIDlets, or mobile phone apps, can be easily ported. With a suitable compatibility layer, we should even be able to run some applets. Java for the Nspire would unlock massive potential.

Pages: [1]