<strong>Java is a good language because it is not platform dependant
...
</strong><hr></blockquote>
Very few languages are 'platform dependant'. Instead, it is usually the upper level APIs, used for hardware abstraction, which are platform dependent. This includes graphics/windowing systems, disk access, etc.
The concept of Java has always been quite good, in theory. However, to create polished Java apps or applets, it is usually necessary to include platform specific code in many places. Also, there are many other development environments and API kits which allow code to be about as platform-agnostic as java.
I've done a considerable amount of work with Java and it?s always been necessary to work around platform specific bugs. Thus, while the java's API is supposedly platform independent, in the real world, it isn't. This is part of the reason why some Java code runs extremely slowly on OS X. While buggy or un-optimized portions of virtual machines can be avoided, developers must take extra care to do so for each platform.
<strong>Why DO people use Java? Seriously? It's slow and unwieldy, it looks to me like it "sucks" sure enough. The only reason I am reluctant to diss it is because it's anti-M$...</strong><hr></blockquote>
First of all, I think the most important question here is "Why is Java so slow on the Mac?" before arguing about the merits of the language. Because whether you like the language or not, it still matters to many people how well Java runs on a particular platform, and Java is particularly slow on the Mac, more so with OS X, even when comparing to Wintel systems at the same MHz speed -- not to mention in comparison to Java running on a +2 GHz Wintel hardware.
Apple's Java has a number of performance problems that should be easy to remedy, if Apple has the will do so, that would make Java run much better on OS X. Their Java is still very usable, however, for many uses right now.
I worked in C++ for nearly seven years. For the last four years or so, I've worked almost exclusively in Java. It's certainly possible to make good, fast, responsive software in Java. It's certainly much easier to produce stable code faster in a language with automatic garbage collection and safety from accidental memory corruption. The cross-platform aspects of Java, while not perfect, are still very helpful for software developers.
Where Java hasn't had much success is in being used for "shrink-wrapped", off-the-shelf commercial software. It's cross-platform GUI will always be a little short of the slickest platform-dependant GUIs out there. (You can write in Java, but tie yourself to OS X, and get nice GUI result with Cocoa from what I hear -- I haven't personally tried this.) Java's not going to be fast enough on any platform, however, for the latest and greatest I-want-1000-frames-per-second-three-D-holographic-imagery with 5.1-channel surround-sound games.
Where Java has been very successful is in server side applications, in code running behind the scenes for web sites and transaction processing. A faster Java for the Mac will be a great aid to OS X's use as a server platform.
Well, my CS professor may have answered one of my questions, which was "what is a misaligned double?"
Here is his response:
"Computer CPUs tend to use an extra cycle when loading/storing a 4-byte data value whose address is not divisible by 4. The same may be true for loading/storing an 8-byte data value whose address is not
divisible by 8. I imagine that this is what the posters were thinking of when they refered to a 'misaligned double'.
The amount of penalty for 'misalignment' can be very different between processors."
So, I guess that's what a misaligned double is. Any ideas on how to fix this aside from waiting for Apple to fix it?
Umm, he means that the same source code can be compiled for different platforms. Obviously you have never strayed away from a GUI or you would be familiar with this and the following sequence of commands:
./configure
make
make install
which is usually all it takes to compile gnu or other open source software on any platform (unix that is - OSX included).
I've tried SOOOO many times to compile my own apps under Mac OS X using the terminal. Each time I try I'm missing the essential parts it needs to compile like amake etc. If you check out my post entitled "Direct Connect for Mac OS X: Second post you'll see all my attempts of trying to compile apps from their sources under Mac OS X. After you guys view that, can you please tell where I can find the nessacary parts and how I can install them? I've tried to use Apple's Developement Tools April 2002 but it doesnt seem to add the missing components. I've even downloaded some "BSD tools" from various sites but its havent figured out how to install them into my system. Typing ./configure didnt do the trick. So if anyone who can help me with this I'd very greatful.
PS. Is there an RPM component for OS X? There are plenty of precompiled apps that I'd like to try.
Generally untrue. Compiled java is pure JVM bytecode, the compiled code is identical for EVERY platform, app or applet.
You can run into problems if you use extensions to Java that aren't part of the prescribed default install. Then your bytecode might expect native libraries to be present that haven't been installed. But it's still the same compiled bytecode.</strong><hr></blockquote>
You know what? I know that. I have no idea what I was thinking when I made that post.
I converted my applet from awt to swing and the speed wasn't noticeably faster.
I believe the math functions (Math.sin(), Math.cos(), etc) or fillOval are the slow parts of my program.
Or perhaps it's just the high amount of math involving doubles, but I don't think that is the problem since my teacher's <a href="http://mathlab.nmu.edu/~bpeterso/CS446/RayTrace-JDK/PanelApplet.html" target="_blank">ray-tracing applet</a> runs relatiely fast on my PowerBook. In fact, my 400Mhz G3 in 10.2.1 runs it almost twice as fast as a 450Mhz G4 in OS 9.
<strong>I converted my applet from awt to swing and the speed wasn't noticeably faster.</strong><hr></blockquote>
Swing isn't really fast. As it is platform independent, it has to do all the drawing by itself.
An interesting alternative for writing Java applications with 'original' platform widgets is SWT. It is included in the eclipse workbench (www.eclipse.org). One of the best java IDEs - and free... The first development builds for MacOS X are now available.
<strong>Ever heard of Fink? It is similar in nature to RPM managers. It is a big help getting GNU software onto OS X. Check it out.
-Aslan</strong><hr></blockquote>
and, in case s/he/they's not heard of it: <a href="http://fink.sf.net" target="_blank">http://fink.sf.net</a> . it doesn't use rpm, but packages more similar to debian. <a href="http://sf.net" target="_blank">http://sf.net</a> is great for all kinds of really free programs. i dont mean juarez, i mean programs made by the developer(s) with the intent of giving them away (freedom has finally arrived).
compiling programs with `./configure && make && sudo make install` may be difficult, but if ur supporting a bunch of people, then you have a techie build it, and install it for them. `real` people have trouble using regular gui installers, so of course they'll botch a cli installer.
Thanks for the link to the sin and cos optimization. I might have to see if I can do that, but since my code is using radians, it might be harder to do.
Apple is apparently skipping right over 1.4 and going to 1.4.1.
When Jaguar was still under development, someone asked on the Omni-dev list about Java 1.4, and an Apple employee replied that their customers had asked for a more robust implementation of 1.3 first. So that's what shipped. But they have been working concurrently on 1.4.
Comments
<strong>Java is a good language because it is not platform dependant
...
</strong><hr></blockquote>
Very few languages are 'platform dependant'. Instead, it is usually the upper level APIs, used for hardware abstraction, which are platform dependent. This includes graphics/windowing systems, disk access, etc.
The concept of Java has always been quite good, in theory. However, to create polished Java apps or applets, it is usually necessary to include platform specific code in many places. Also, there are many other development environments and API kits which allow code to be about as platform-agnostic as java.
I've done a considerable amount of work with Java and it?s always been necessary to work around platform specific bugs. Thus, while the java's API is supposedly platform independent, in the real world, it isn't. This is part of the reason why some Java code runs extremely slowly on OS X. While buggy or un-optimized portions of virtual machines can be avoided, developers must take extra care to do so for each platform.
[ 09-20-2002: Message edited by: dfiler ]</p>
<strong>Why DO people use Java? Seriously? It's slow and unwieldy, it looks to me like it "sucks" sure enough. The only reason I am reluctant to diss it is because it's anti-M$...</strong><hr></blockquote>
First of all, I think the most important question here is "Why is Java so slow on the Mac?" before arguing about the merits of the language. Because whether you like the language or not, it still matters to many people how well Java runs on a particular platform, and Java is particularly slow on the Mac, more so with OS X, even when comparing to Wintel systems at the same MHz speed -- not to mention in comparison to Java running on a +2 GHz Wintel hardware.
Apple's Java has a number of performance problems that should be easy to remedy, if Apple has the will do so, that would make Java run much better on OS X. Their Java is still very usable, however, for many uses right now.
I worked in C++ for nearly seven years. For the last four years or so, I've worked almost exclusively in Java. It's certainly possible to make good, fast, responsive software in Java. It's certainly much easier to produce stable code faster in a language with automatic garbage collection and safety from accidental memory corruption. The cross-platform aspects of Java, while not perfect, are still very helpful for software developers.
Where Java hasn't had much success is in being used for "shrink-wrapped", off-the-shelf commercial software. It's cross-platform GUI will always be a little short of the slickest platform-dependant GUIs out there. (You can write in Java, but tie yourself to OS X, and get nice GUI result with Cocoa from what I hear -- I haven't personally tried this.) Java's not going to be fast enough on any platform, however, for the latest and greatest I-want-1000-frames-per-second-three-D-holographic-imagery with 5.1-channel surround-sound games.
Where Java has been very successful is in server side applications, in code running behind the scenes for web sites and transaction processing. A faster Java for the Mac will be a great aid to OS X's use as a server platform.
[ 09-20-2002: Message edited by: shetline ]</p>
Here is his response:
"Computer CPUs tend to use an extra cycle when loading/storing a 4-byte data value whose address is not divisible by 4. The same may be true for loading/storing an 8-byte data value whose address is not
divisible by 8. I imagine that this is what the posters were thinking of when they refered to a 'misaligned double'.
The amount of penalty for 'misalignment' can be very different between processors."
So, I guess that's what a misaligned double is. Any ideas on how to fix this aside from waiting for Apple to fix it?
------------------------------------------------------------------------
Originally posted by gmon:
Umm, he means that the same source code can be compiled for different platforms. Obviously you have never strayed away from a GUI or you would be familiar with this and the following sequence of commands:
./configure
make
make install
which is usually all it takes to compile gnu or other open source software on any platform (unix that is - OSX included).
------------------------------------------------------------------------
I've tried SOOOO many times to compile my own apps under Mac OS X using the terminal. Each time I try I'm missing the essential parts it needs to compile like amake etc. If you check out my post entitled "Direct Connect for Mac OS X: Second post you'll see all my attempts of trying to compile apps from their sources under Mac OS X. After you guys view that, can you please tell where I can find the nessacary parts and how I can install them? I've tried to use Apple's Developement Tools April 2002 but it doesnt seem to add the missing components. I've even downloaded some "BSD tools" from various sites but its havent figured out how to install them into my system. Typing ./configure didnt do the trick. So if anyone who can help me with this I'd very greatful.
PS. Is there an RPM component for OS X? There are plenty of precompiled apps that I'd like to try.
Tootles..!!
[ 09-23-2002: Message edited by: Proud iBook Owner 2k2 ]</p>
<strong>
Generally untrue. Compiled java is pure JVM bytecode, the compiled code is identical for EVERY platform, app or applet.
You can run into problems if you use extensions to Java that aren't part of the prescribed default install. Then your bytecode might expect native libraries to be present that haven't been installed. But it's still the same compiled bytecode.</strong><hr></blockquote>
You know what? I know that. I have no idea what I was thinking when I made that post.
I believe the math functions (Math.sin(), Math.cos(), etc) or fillOval are the slow parts of my program.
Or perhaps it's just the high amount of math involving doubles, but I don't think that is the problem since my teacher's <a href="http://mathlab.nmu.edu/~bpeterso/CS446/RayTrace-JDK/PanelApplet.html" target="_blank">ray-tracing applet</a> runs relatiely fast on my PowerBook. In fact, my 400Mhz G3 in 10.2.1 runs it almost twice as fast as a 450Mhz G4 in OS 9.
<strong>
You know what? I know that. I have no idea what I was thinking when I made that post.</strong><hr></blockquote>
You were probably thinking of a native java compiler (http://gcc.gnu.org/java/).
<strong>I converted my applet from awt to swing and the speed wasn't noticeably faster.</strong><hr></blockquote>
Swing isn't really fast. As it is platform independent, it has to do all the drawing by itself.
An interesting alternative for writing Java applications with 'original' platform widgets is SWT. It is included in the eclipse workbench (www.eclipse.org). One of the best java IDEs - and free... The first development builds for MacOS X are now available.
<strong>I converted my applet from awt to swing and the speed wasn't noticeably faster.
</strong><hr></blockquote>
Swing has always been slower than AWT because it's implemented entirely in Java. And Java IS dog slow, especially drawing.
[quote]Originally posted by rogue27:
<strong>I believe the math functions (Math.sin(), Math.cos(), etc) or fillOval are the slow parts of my program.</strong><hr></blockquote>
You can profile (eg. <a href="http://www.codework.com/optimize/product.html)" target="_blank">http://www.codework.com/optimize/product.html)</a> your program to find out what exactly slows it down. Depending on how you use sin() and cos() and the maximum error permitted, you might want to build a lookup table or use approximation methods to speed up your code. Here's a collection of sine optimization techniques: <a href="http://www.interstice.com/~sdattalo/technical/theory/sinewave.html" target="_blank">http://www.interstice.com/~sdattalo/technical/theory/sinewave.html</a>
123
Ever heard of Fink? It is similar in nature to RPM managers. It is a big help getting GNU software onto OS X. Check it out.
-Aslan
<strong>Ever heard of Fink? It is similar in nature to RPM managers. It is a big help getting GNU software onto OS X. Check it out.
-Aslan</strong><hr></blockquote>
and, in case s/he/they's not heard of it: <a href="http://fink.sf.net" target="_blank">http://fink.sf.net</a> . it doesn't use rpm, but packages more similar to debian. <a href="http://sf.net" target="_blank">http://sf.net</a> is great for all kinds of really free programs. i dont mean juarez, i mean programs made by the developer(s) with the intent of giving them away (freedom has finally arrived).
compiling programs with `./configure && make && sudo make install` may be difficult, but if ur supporting a bunch of people, then you have a techie build it, and install it for them. `real` people have trouble using regular gui installers, so of course they'll botch a cli installer.
I regularly use a 1.5GHz Dell machine running W2K and JDK 1.4 and the speeds are comparable.
I would be nice to know where 1.4 is though. Not being able to use some of the new stuff in 1.4 is beginning to get annoying.
When Jaguar was still under development, someone asked on the Omni-dev list about Java 1.4, and an Apple employee replied that their customers had asked for a more robust implementation of 1.3 first. So that's what shipped. But they have been working concurrently on 1.4.