Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI-Nspire => Topic started by: Goplat on January 16, 2011, 05:55:59 pm

Title: Java on the TI-Nspire?
Post by: Goplat on January 16, 2011, 05:55:59 pm
I've discovered that the TI-Nspire's CPU supports a feature called Jazelle which allows Java code to be partially interpreted by hardware, making it significantly faster than it would be with a plain interpreter. Obviously, the 90MB Java runtime environment is never going to fit on the Nspire, but I wonder if it might be practical to port something like J2ME. It seems a shame to let that hardware go to waste ;)

Here's a little test program, that uses Jazelle to calculate 2+2 (impressive, huh? ;D)
Title: Re: Java on the TI-Nspire?
Post by: apcalc on January 16, 2011, 06:05:46 pm
This looks pretty interesting!

Now that I kinda know Java in preparation for AP Computer Science, I guess I would be interested in trying this! :)

Great find, Goplat! :D
Title: Re: Java on the TI-Nspire?
Post by: bsl on January 16, 2011, 08:20:09 pm
Nice find Goplat !!!!
I was looking into that possibility a year ago before Ndless came out.
I though I read in the ARM docs somewhere that Jazelle was superceded with something else -
that could run byte code from other interpreted languages - its been a while
I have to go over the documentation again.
EDIT: Jazelle's successor : ThumbEE
Title: Re: Java on the TI-Nspire?
Post by: qazz42 on January 16, 2011, 10:05:20 pm
and yet no .NET support for .NET programmers like me :(

other than that,, nice find
Title: Re: Java on the TI-Nspire?
Post by: SirCmpwn on January 16, 2011, 10:23:31 pm
I've been thinking about how hard it would be to port Mono, so just wait a bit :)
Title: Re: Java on the TI-Nspire?
Post by: willrandship on January 16, 2011, 11:30:12 pm
Well, about the JRE size issue, there is an SD host on the bottom dock port, so we might get another 32 GB added to that :w00t:

Unfortunately, this doesn't mean minecraft :P
Title: Re: Java on the TI-Nspire?
Post by: z80man on January 17, 2011, 01:26:17 am
Hmm if only TI made calcs with x86 procs, then we would have minecraft :P
Title: Re: Java on the TI-Nspire?
Post by: fb39ca4 on January 17, 2011, 08:51:52 am
A minecraft clone could be doable using a raycaster, but the maps would have to be quite small.
Also, I dont think the architecture of the processor matters-Java was designed so it could be ported to (almost) any system.
Title: Re: Java on the TI-Nspire?
Post by: Munchor on January 17, 2011, 08:54:54 am
A minecraft clone could be doable using a raycaster, but the maps would have to be quite small.
Also, I dont think the architecture of the processor matters-Java was designed so it could be ported to (almost) any system.

And there is already a nice raycaster, right? Oh wait, it's not Java. But I think Mark (creator of ndoom) used premade code for doom, so premade code of MineCraft would be possible?
Title: Re: Java on the TI-Nspire?
Post by: calc84maniac on January 17, 2011, 09:08:26 am
Is minecraft open source? If not, then no.
Title: Re: Java on the TI-Nspire?
Post by: Munchor on January 17, 2011, 09:09:14 am
Is minecraft open source? If not, then no.

Yeah, I forgot that.
Title: Re: Java on the TI-Nspire?
Post by: fb39ca4 on January 17, 2011, 09:37:08 am
No,  I meant doing it from scratch, as the PC version takes up waaaaaaaaay too much memory to fit on the nspire. I got an out of memory error once on a computer with 2GB ram and nothing else running.
Title: Re: Java on the TI-Nspire?
Post by: Deep Toaster on January 17, 2011, 12:30:18 pm
A simple version of Java? That'd be really awesome!

Plus we don't have to worry about networking or any of that stuff, so you could get the JRE nice and small :D
Title: Re: Java on the TI-Nspire?
Post by: ExtendeD on January 17, 2011, 02:46:06 pm
This is brilliant!
I thought Jazelle was disabled on the TI-Nspire.
Title: Re: Java on the TI-Nspire?
Post by: willrandship on January 17, 2011, 03:10:48 pm
But so was third party coding in general :P until you came along :)
Title: Re: Java on the TI-Nspire?
Post by: Builderboy on January 17, 2011, 03:20:55 pm
Java on the nSpire would we excelent! :D Heh although what would the advantages be over C compiling?
Title: Re: Java on the TI-Nspire?
Post by: calc84maniac on January 17, 2011, 04:08:42 pm
Java on the nSpire would we excelent! :D Heh although what would the advantages be over C compiling?
I think the only advantage is if you happen to love Java :P
Title: Re: Java on the TI-Nspire?
Post by: z80man on January 17, 2011, 04:27:33 pm
Java does have all those handy built in libraries. Good for a lot of that graphical programming.
Title: Re: Java on the TI-Nspire?
Post by: DJ Omnimaga on January 18, 2011, 02:35:15 am
Woah nice Goplat! It would be nice to have something like Java on the Nspire, since a lot of people use it.
Title: Re: Java on the TI-Nspire?
Post by: squalyl on January 18, 2011, 05:37:15 am
Hello,

I've working on a portable cldc JVM for some months now, part time of course.

Thanks to goplat, it will support jazelle on the nspire, now I know how to do that thanks to him. This was a known unknown, and now its a known known (sorry :D).

I have no release date since it's a big project and I'm busy, but I will let you know my progress here.

FYI, I can load classes from memory or file. When classes are in memory, I will be able to do XIP, ie, classes will not use more RAM if they're available from flash. The goal is to support the TI68K platform.

There is no JAR support for the moment, that's useless. I may add it in the future.

I'm working on threads, which means the stack and bytecode execution is not far away.
Title: Re: Java on the TI-Nspire?
Post by: Ashbad on January 18, 2011, 09:34:21 am
interesting, java on the nspire!  My firend actually was bullshitting me earlier this week saying he had a friend who could already send compiled .class files from comp to calc (Nspire of course) and run right after comp compiling.  Using TIconnect for the nspire non-84+ version: BS then.  But one day, it won't be!
Title: Re: Java on the TI-Nspire?
Post by: alberthrocks on January 18, 2011, 09:39:15 am
Very nice! :D
Also, I would be interested in seeing Python and a GUI lib on TI-Nspire too! ;)

(Or better yet, Linux if we can do it!)
Title: Re: Java on the TI-Nspire?
Post by: Ashbad on January 18, 2011, 09:41:09 am
A bit unrelated, but C++ on nspire would get me to buy one! :D
Title: Re: Java on the TI-Nspire?
Post by: Goplat on January 18, 2011, 04:20:08 pm
Hello,

I've working on a portable cldc JVM for some months now, part time of course.

Thanks to goplat, it will support jazelle on the nspire, now I know how to do that thanks to him. This was a known unknown, and now its a known known (sorry :D).

I have no release date since it's a big project and I'm busy, but I will let you know my progress here.

FYI, I can load classes from memory or file. When classes are in memory, I will be able to do XIP, ie, classes will not use more RAM if they're available from flash. The goal is to support the TI68K platform.

There is no JAR support for the moment, that's useless. I may add it in the future.

I'm working on threads, which means the stack and bytecode execution is not far away.

Are you porting an existing VM or writing one from scratch?

BTW, there's a bit more to using Jazelle than what I used in the little demo program. I'll post what I know on Hackspire soon.
Title: Re: Java on the TI-Nspire?
Post by: DJ Omnimaga on January 18, 2011, 04:29:04 pm
Sounds promising Squalyl! Good luck!
Title: Re: Java on the TI-Nspire?
Post by: ExtendeD on January 18, 2011, 05:07:11 pm
There is some info on Jazelle this thread (http://www.gossamer-threads.com/lists/maemo/developers/24295), not sure how accurate/up-to-date it is.
Title: Re: Java on the TI-Nspire?
Post by: Jonius7 on January 18, 2011, 08:11:10 pm
i guess there's lots of advantages Java is newer. but also java is used on webplatforms as well as executable runtimes.
Title: Re: Java on the TI-Nspire?
Post by: willrandship on January 18, 2011, 09:00:55 pm
Don't forget everyone that Java compiles to bytecode, which is cross-compatible between ARM, x86, you name it. You just need the libraries (ie openGL() to get stuff to work.
Title: Re: Java on the TI-Nspire?
Post by: ruler501 on January 18, 2011, 09:02:19 pm
Python would be great on the Nspire
Title: Re: Java on the TI-Nspire?
Post by: willrandship on January 18, 2011, 09:15:41 pm
much more doable than most, since it's both Open-source and scripted, not compiled
Title: Re: Java on the TI-Nspire?
Post by: SirCmpwn on January 18, 2011, 09:35:26 pm
Speaking of alternative languages for the TI-Nspire, I have a folder on my Nspire named "Nterpret", which is the product of a promise I made about what I would do if I won the Axe contest and bought an Nspire.
Title: Re: Java on the TI-Nspire?
Post by: ruler501 on January 18, 2011, 10:25:33 pm
So what is it?
Title: Re: Java on the TI-Nspire?
Post by: SirCmpwn on January 18, 2011, 11:16:49 pm
A teaser :)
Title: Re: Java on the TI-Nspire?
Post by: squalyl on January 19, 2011, 02:15:02 am
Goplat: it is a write from scratch. I don't know about performances yet, the goal is to understand the internals of a jvm.
So, instead of porting one, I made one, so that I control it, and I can make it suitable to embedded objects.

it will have the ability to run plain compiled .class files, also .jar, although they are not the most interesting format I know.
Title: Re: Java on the TI-Nspire?
Post by: DJ Omnimaga on January 19, 2011, 11:32:07 pm
/me wonders if Sir wrote a new BASIC interpreter or something O.O
Title: Re: Java on the TI-Nspire?
Post by: SirCmpwn on January 19, 2011, 11:55:53 pm
What?  Did I hear my name?
Title: Re: Java on the TI-Nspire?
Post by: z80man on January 20, 2011, 12:12:25 am
If there was a new Basic interpreter for the nspire that would finally convince me to pay up $160 for one.
Title: Re: Java on the TI-Nspire?
Post by: SirCmpwn on January 20, 2011, 12:30:28 am
<.<
Title: Re: Java on the TI-Nspire?
Post by: z80man on January 20, 2011, 12:37:48 am
<.<
What?  Did I hear my name?
I think some people want to know what Nterpret is
Title: Re: Java on the TI-Nspire?
Post by: SirCmpwn on January 20, 2011, 12:39:05 am
It's a pun.
Title: Re: Java on the TI-Nspire?
Post by: DJ Omnimaga on January 20, 2011, 08:24:10 pm
Lol. Oh well, I guess we'll know one day anyway :P (unless parents strike)
Title: Re: Java on the TI-Nspire?
Post by: qazz42 on January 20, 2011, 08:35:55 pm
I think he wrote a brainfuck interpreter...
Title: Re: Java on the TI-Nspire?
Post by: SirCmpwn on January 20, 2011, 08:48:05 pm
No, but that's a good idea now that you mention it.
Title: Re: Java on the TI-Nspire?
Post by: qazz42 on January 20, 2011, 08:56:56 pm
heh, I alreadyy think I know what you made. Either a C# or a Java interpriter. PLEASE BE A C# INTERPRITER!
Title: Re: Java on the TI-Nspire?
Post by: DJ Omnimaga on January 20, 2011, 08:58:00 pm
Knowing he likes C# I wouldn't be surprised if that was the case, assuming such thing is possible on the Nspire.
Title: Re: Java on the TI-Nspire?
Post by: qazz42 on January 20, 2011, 08:59:32 pm
It should be.... I hope... please?
Title: Re: Java on the TI-Nspire?
Post by: ruler501 on January 20, 2011, 09:02:13 pm
C++ would be great to have(at least for me)

*ruler wonders if he has no interpreter
Title: Re: Java on the TI-Nspire?
Post by: qazz42 on January 20, 2011, 09:03:18 pm
C is already possible for the nspire, isnt that enough? :P
Title: Re: Java on the TI-Nspire?
Post by: DJ Omnimaga on January 20, 2011, 09:03:33 pm
Note: we should probably keep this topic related to Java, though. Maybe have a new topic for other language ideas? (I think there was one already, actually).
Title: Re: Java on the TI-Nspire?
Post by: ruler501 on January 20, 2011, 09:04:54 pm
C is possible? How do you use it on the calc?
(Sorry if this is a stupid question)
Title: Re: Java on the TI-Nspire?
Post by: qazz42 on January 20, 2011, 09:08:49 pm
err, there is a topic for that... anyone have a link?
Title: Re: Java on the TI-Nspire?
Post by: DJ Omnimaga on January 20, 2011, 09:09:28 pm
You might want to check the C sub-forum on the forums as it has some info on how to get started with C programming for the TI-Nspire. Hopefully that helps.
Title: Re: Java on the TI-Nspire?
Post by: renatose on December 08, 2011, 02:20:10 pm
I'm wondering if anyone is thinking about doing this...

Necropost! :P
Title: Re: Java on the TI-Nspire?
Post by: AngelFish on December 08, 2011, 02:32:31 pm
renatose, I don't think anyone wants to invest the time necessary to get it to work. Jazelle is a good start, but it's nowhere near a functioning JVM and most of the hard stuff would still have to be written.
Title: Re: Java on the TI-Nspire?
Post by: DJ Omnimaga on December 08, 2011, 02:33:18 pm
Couldn't something like Khavi be done for the Nspire or is Khavi specifically designed with SH3/4 processors in mind?
Title: Re: Java on the TI-Nspire?
Post by: AngelFish on December 08, 2011, 02:34:45 pm
Khavi is specifically for SH3/SH4 processors, although there's no reason you couldn't do something like it for ARM. However, Jazelle would be slightly faster because it has hardware support for opcode interpretation, which Khavi has to do manually.
Title: Re: Java on the TI-Nspire?
Post by: renatose on December 08, 2011, 02:34:49 pm
ok... cuz it'd be great to have all the .jar apps for J2ME working on the nspire.
Title: Re: Java on the TI-Nspire?
Post by: DJ Omnimaga on December 08, 2011, 02:36:49 pm
Ah ok. Well it looks like it would be a lot of work definitively. just Khavi has been worked on for half a year, I think, and from the progress I saw (publicly), it didn't seem to be close to have reached a fully functional state yet.