PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Java compiler/editor for PPC

I was wondering if there is a Java compiler/editor for the PPC?
it doesn't matter.
Google-.......
On my old Axim X5 I believe it came with such a link on the extras cd.
RDDF wrote:I was wondering if there is a Java compiler/editor for the PPC?


There is none - no JDK's, only JVM's are available.
Menneisyys":38tvborl]

You're wrong Menneisyys
IBM provides a Java 1.3 full JDK
PepeGG":145tweum]
Menneisyys wrote:

That's great news. Could you give us the URL?
Java is painfully slow on desktop PCs. I would be very surprised if you could build anything usable on a pocket pc.
Man, you just opened a can of worms there. Hahahaha.
j.edwards wrote:Java is painfully slow on desktop PCs. I would be very surprised if you could build anything usable on a pocket pc.


For quick prototyping and/or running apps that otherwise have no WinCE implementation (e.g., ever tried to generate PDF's on a WinCE machine? Or, run a decent HTTP proxy?), it's OK.
j.edwards wrote:Java is painfully slow on desktop PCs. I would be very surprised if you could build anything usable on a pocket pc.

I'm no Java fanboy either, but have you ever seen the IntelliJ Idea IDE?
That's an example of a very nice and fast Java application.
PepeGG":2cezb5n9]
Menneisyys wrote:

As far as I know, the only way to obtain it is to download the trial version of WSDD, look for it at:

http://www-306.ibm.com/software/wireless/wsdd/
j.edwards wrote:Java is painfully slow on desktop PCs. I would be very surprised if you could build anything usable on a pocket pc.


I don't know on PocketPCs, but on my laptop Java is fine.
The way java eats through memory, I wouldn't want anything java-based running on my laptop on a persistant basis. It's probably possible to minimize the 'hurt' by explicity setting mem flags and all that, but fortunately I'm not in a position where I have to bother.
As someone who codes enterprise Java applications (web applications mostly) all day long for a living...

The "java speed sux" argument has long since been dispelled as a myth that was only ever a reality in the relatively early days. The last 2 or 3 JDKs have had performance that for most tasks is on par with native code.

There ARE still parts of the java spec that aren't too good speed-wise... anything GUI-related comes to mind immediately (although there are a number of very complex apps that perform very well, Oracel JDeveloper is the best example I can think of).

The speed issue is no longer the case because generally because the JIT compilers have become so good at optimizing that they can gain efficiencies that a native program can't, enough to overcome the inherent slowness of a virtual machine architecture.

Look at it this way... when you write a C program and compile it, it's in it's final form, that's the native code that's going to execute. But at runtime your program has more information about what it's doing, the data it's fed maybe, the condition of the underlying hardware, etc. Too bad! Your program still runs as written.

Contrast this with Java, where the JVM has A LOT of information during runtime and can actually perform optimizations on-the-fly to your code (within limits of course). This is a very powerful feature, and one of the main reasons Java is now, speed-wise, comperable to native code for most tasks (and there are examples out there of studies that show it being FASTER in some cases).

Now, jumping to the question of running full Java on a PDA... I would certainly agree that Java uses much more memory than a native app, sometimes frightingly so! For that reason alone it's not really well-suited to limited resource devices, and it's the reason J2ME was created... They took out most of the parts that would cause memory and speed penalties on such devices, and rewrote others to make it more applicable. Even still, I have a J2ME-capable cell phone, and while the apps run acceptably, including a couple of decent games, it's not on par with native apps.

So, don't diss Java! :) You can say it's not great on a PocketPC, and I'd agree, but in general the speed argument just doesn't hold water any more.
@fzammetti:
Where i work, one of the development heads just told me quite the contrary.
He's managing quite large scale java business applications but also large C++
projects and he said that speed differences are immense but sometimes
you have to sacrifice speed for ease of use and garbage collection.
I'd be interested to know what kind of application he's doing. It's absolutely true that there are still instances where Java will get it's butt kicked, but as you said, tradeoffs for other benefits come into play.

We recently did an application where we were pulling data from about ten different sources, doing a lot of manipulation, and creating an operationl data store. Some guys on the team wanted to do this all in Java and I had to fight thooth and nail to convince them not to. We did some small-scale tests, they did the Java version and I did the straight C version, and the difference was immense, in favor of C. That was almost entirely string manipulations and things of that nature, and a lot of it. My point being that while Java has come a long way and is in most cases on par, in some it's still not the best choice.
From what I've seen, you're throwing away at least 20% performance and probably a larger % memory-wise (vs a good c solution). To be fair, I don't think I've ever written anything over 2,000 lines in java.

I'm kind of curious, have any of you replaced significant C/C++ based programs with Java ones (or the other way around) and compared the results? Benchmarks are all well and nice, but they kind of leave you guessing for how things of similar-task (rather than similar function) really compare given normal dev. practice.
Is there ever any situation where a program like Java, Perl, etc, won't be faster than a C app?
In practice, I think a C/C++ app will always win. It's hard to say exactly how much the language differences are responsible for the speed gap, and how much of it is actually due to the underlying technology. At least with my level of knowledge.

And to be fair, I think the senior developers probably have nightmares about C++ tasks they gave out to interns and junior developers.
Andy: As a matter of fact I have :) I originally had an application to do custom encoding of large (10MB+) files at work that was written in C (not even C++, just straight C). I rewrote it in Java some months ago (as per the corporate directive to do everything in Java). To encode a 10MB test file with the old version took 3.24 minutes to complete on average, the Java version now takes 3.23 minutes, and that's (a) not the latest JDK and (b) without doing ANY optimizations, it was more or less a 1-1 conversion, at least the main encoding algorithm was. Not a big enough difference to jump up and down about, but a difference none the less. If you had asked me my expectation before I did that, I would have expected the C version to be faster, and perhaps significantly.

Sponge: Generally speaking, computationally-intensive tasks where there isn't a lot of redundancy through a loop (i.e., a lot of potential branching and such) will usually favor C. C will still win in just about anything graphics-related (I have actually seen Doom written in Java and run as an applet no less and it was pulling about 50FPS, but in general I wouldn't do much game programming in Java even today). Anything that's doing a lot of string manipulation will tend to favor C (although you can get close in Java by doing things the "right" way).

I can't speak much about Perl though.
Maybe I'm just ill-informed, but isn't the whole java graphical component it's own implementation? i.e. it doesn't use any native windows controls so that it can be "the same" across all platforms?

I have recently gone from C++ to managed .NET code and .NET is SLOW. In fact it's so slow that the last few weeks I've been rebuilding most of the controls by wrapping winapi calls with p/invoke. And .NET uses underlying win32 stuff - i.e. doesn't have it's own graphical interface.

So I just can't understand how Java could perform anywhere near usable except for the simplest of applications. Fair enough if it runs well in enterprise situations with no GUI.

My experience with Java has been limited to using a couple of apps on workstations - none of which have been very usable at all. My only experience with an Oracle java product is their database studio piece of rubbish that comes with Oracle 8i - man what a joke!
I'm really surprised that the java encoding matched/beat the C version. That'd be interesting code to profile. Kind of wonder if something different is happening with or around the input file.
j.edwards: It's a choice actually... you can in fact use components that are light-weight, i.e., they are basically a thin layer over the native components. I have to be fair and admit that I haven't done a whole lot of GUI development in Java, so I don't know all the details. I do know that Java GUIs aren't as bad as they used to be (although I still don't like Java GUIs by and large). For some good examples though, check out Eclipse, jEdit, Oracle JDeveloper and Oracle Enterprise Manager. They do all suffer the same typical bad startup time for a Java app, but once they are running, they really do run quite well, nearly on par with a native GUI app.

So I just can't understand how Java could perform anywhere near usable except for the simplest of applications.


That was always my opinion as well, which is why I encourage you to check out the apps I mentioned (jEdit is a nice open-source programmer's editor, really more of a whole IDE actually... I think you'd find it fairly impressive, especially in light of your feeling about Java GUIs).

My experience with .Net is fairly limited and only dealing with web applications, so I can't make any comment there at all.

Andy: I'd be interested just to see if I can dig up the old C code for that :) I have a sneaking suspicion it hit the bit bucket at work.

I can't say whether it was implemented as efficiently as possible in C, but I do remember when I was converting it that it seemd to be pretty well-written (I only contributed a small part to the original C code by the way). I wouldn't be surprised if there was some tweaking that could have been done, but those tweaks would have translated to the Java version as well since they were virtually identical.

The way any Java app comes close or exceeds in cases like this is because of the runtime optimizations that can be done. With a virtual machine, there are a lot of statistics that the machine can look at to make decisions about the code being executed, and many times will make things more efficient. This can't ever happen with a native piece of code, unless you've built all that kind of stuff in yourself of course.

I mean, at the end of the day, assuming the code is well-written, a C program executing is going to be executing less machine ops than a comperable Java program will. That HAS to be true because the JVM is running a TON of machine ops just to run that program. But, the difference is that the JVM can perform optimizations at a much higher level than the executing native program even knows about (because it's essentially lost once it's compiled), and knows about things that only come in to play at runtime. This is where interpreted/virtual machine-based languages get speed benefits, when they get any at all.
almost all Java VMs perform dynamic recompilation now, making the speed problem due to the language itself irrelevant. The Hotspot technology is quite old and working pretty well, even in the embedded world (see the excellent Java VM included with the C500 Microsoft Smartphone, Intent Tao and this site benchmarking embedded Java VMs http://www.jbenchmark.com/index.html?F=2).

It's true that badly coded Swing can crawl, but for this, you can try another widget API such as the semi-native SWT used by the Eclipse project http://www.eclipse.org, or optimize your code :wink:

In my opinion the remaining problems of Java in 2005 is that the desktop Java is quite memory and resource hungry (and it's surprinsingly easy to write bad code in Java, resources wise), even if the garbage collector has been improved a lot. And the most common embedded Java platform (MIDP/CLDC) is a bit too limited, even if the JCP is a fast standardization entity (~ 1 year for a standard). For example, it's still not possible to access an external storage device such as a memory card, which is a huge flaw on todays devices (and JSR 75 is too recent and a bit too confusing to be implemented quickly).