In this article, Chet Hasse talks about some of the new features of Tiger (Java 1.5) intended for programmers of desktop applicatons. Some of the highlights include OpenGL rendering for accelerated graphics capabilities, and hardware accelerated image copies have been extended to all image methods with no programmer intervention required for hardware accelerated copies to be used when they can be used. CUPS support and printing of JTable objects has also been added, along with several other major desktop enhancements.
just think of what would happen if MS decided to make Java as important on its desktop as C++ and VB are.
Sort of whacky that Apple and Sun haven’t coordinated their code-names better, huh?
“just think of what would happen if MS decided to make Java as important on its desktop as C++ and VB are.”
Fortunatly, Sun has done a pretty good job of making Java integrate with Windows though. For example, jar files can be executed just by double clicking on them, the Windows look and feel picks up Windows color schemes and even the correct widget style depending on whether XP or Classic themes are used, and dialogs such as JFileChooser even theme themselves to look like Windows dialogs (including even adding the sidebar).
“Sort of whacky that Apple and Sun haven’t coordinated their code-names better, huh?”
Sun’s use of “Tiger” was no doubt inspired by O’Reilly books on Java, several of which have uses a tiger for the cover art.
<just think of what would happen if MS decided to make Java as important on its desktop as C++ and VB are.[/i]
Why should they? Sun already has a windows java version and C# and the CLR are better than Java and the JVM. Until Sun gets some decent fonts for Java, it will look like crap on the desktop.
Microsoft tried that. They got sued. So now there’s C#.
This was done in a time when Swing was far, far worse than it is now, so it was no suprise that Microsoft – or anyone – would pimp a set of GUI classes that wasn’t Swing.
“Why should they? Sun already has a windows java version and C# and the CLR are better than Java and the JVM.”
Yeah right. Java outperforms C# and CLR by quite a wide margin. Applications load faster, arithmetic is faster, etc.
“Until Sun gets some decent fonts for Java, it will look like crap on the desktop.”
A: Have you tried Tiger? The revamped default look and feel has much better fonts.
B: If you use the Windows look and feel, the fonts used are the Windows system fonts, and they look no different than any other Windows application.
“Until Sun gets some decent fonts for Java, it will look like crap on the desktop.”
http://www.netbeans.org/images/screenshots/4.0/Refactoring1.png
If no one told you this was a Java application and not a native Windows application, you would never know the difference.
So much for Java “looking like crap” on the desktop, or not having decent fonts.
Those fonts in the screenshot look like crap to me. Do you have the ability to use cleartype in java?
Yeah right. Java outperforms C# and CLR by quite a wide margin. Applications load faster, arithmetic is faster, etc.
Applications load faster? doubtful, unless Java 1.5 is caching JIT code now. Java has a fundamental problem in that there are no user-defined value types in java. Allocating objects from the heap isn’t the problem. That can be just about as fast as pushing a stack pointer, but the problem is garbage collecting all of that stuff. So numerical computing in theory will not be faster than Java than the CLR when you have tens, if not hundreds of thousands of little objects allocated.
“Those fonts in the screenshot look like crap to me. Do you have the ability to use cleartype in java?”
AWT windows will use cleartype. But Swing windows will not. However, the fonts that you see in the menus and such are normal Windows system fonts. The font in the IDE looks a bit crappy partially because Netbeans defaults to a really small font.
“Applications load faster? doubtful, unless Java 1.5 is caching JIT code now.”
Applications do load significantly faster in Tiger than they do in Java 1.4.
“So numerical computing in theory will not be faster than Java than the CLR when you have tens, if not hundreds of thousands of little objects allocated.”
“So numerical computing in theory will not be faster than Java than the CLR when you have tens, if not hundreds of thousands of little objects allocated.”
Of course, this depends on what other things the VM is doing while the computations are running, so yes, there can be differences in numerical computation in different VMs. (Not because of the numerical computation itself being less efficient, but because the VM is running many threads at the same time.) If the garbage collector runs, for example while the computation is being done, it is going to slow things down.
Java has a very efficient garbage collector, and it only runs during periods of relative idleness. I don’t know enough about the internals of the CLR to know how efficient its garbage collector is.
Funny you ask about using Cleartype in Java, when I am trying to get rid of it (system wide).
I won’t deny that Cleartype can look damn good, but the more I use Cleartype with fonts that are not Verdana/Tahoma/Times New Roman, the more I dislike it.
For example. my current set of fonts for the web and documents is the Bistream Vera family. Unfortunately, those fonts look horrible on small sizes when using Cleartype, making it impossible for me to use them in the GUI. The only font that looks *somewhat* decent at 10 points is Vera Sans Mono, while Vera Sans has a lot of weird spacing between letters and Vera Serif does not look that good either. I had a similar experience in the past with the Nu Sans family, which used to be my default family before starting to use Vera.
You can also see this distortion with other fonts. For example, Courier New becomes too light in size 10 or less, while other fonts become too thick.
The Vera fonts really shine on Linux (which is what is used in GNOME) and my mother’s iMac. Ironically, the only place where the fonts look good on my Windows laptop is on jEdit (a Java application) whenever I enable antialaiasing.
I could disable ClearType, but for some reason Microsoft never enabled antialiasing for fonts size 10 or smaller. If it were by me, I would take out Windows’ font engine and use one based in say, Freetype.
Java has a fundamental problem in that there are no user-defined value types in java.
User-defined value types are unnecessary. Indeed, the distinction between “heap objects” and “stack objects” is unnecessary. The escape analysis to determine when an object can be stack-allocated is old as dirt.
Sun’s garbage collector is very good, and is based on a more advanced algorithm (train), than .NET’s (mark and sweep). I hear .NET’s is very well-implemented, though, and should be competitive in practice.
One of the comments on the page mentioned the HTML display/editing component. That is also one of my pet hates in Java, the thing is nearly useless and does not work as advertised at all. I suspect that they will need a rewrite to get the required funcionality though as the backend gave me nightmares.
That said, it is good to finally get some movement on issues such as fonts. Perhaps client-side java developers have something to look forward to after all. We’ve had over 5 years of solely server-side Java improvements.
@Raynier – Read the rest of my comment. I even stated that it wasn’t about stack-allocation vs. heap-allocation, it was about the garbage collector cleaning up those hundreds of thousands of small objects vs. moving a stack pointer back. No matter how advanced the garbage collector is, you can’t get away from the fact that cleaning up all those objects is going to cost more than a simple stack pointer move.
@VamOMana – Yeah, I use Verdana fonts on my system and it looks great. The only time I’ve ever seen linux fonts look almost as good as XP cleartype fonts is in the screenshot from the article about an HP thin-client running XFCE. I’d be curious to know what they’re using. Looks Vera to me, but I could never get Vera or Verdana looking that good on my gnome desktop.
Sorry if I wasn’t clear. Escape analysis allows you to stack allocate objects when the compiler can show that a pointer to the object cannot escape the dynamic extent of the function. Eg:
1. MyClass foo;
2. MyClass bar;
3. foo.doStuff();
4. bar.doStuff();
5. return bar;
Assuming that ‘doStuff()’ doesn’t store a pointer to ‘this’ in a global object, ‘foo’ will be stack-allocated, while ‘bar’ will be heap-allocated.
still no release date. I recent wiped my TabletPC clean and wasn’t planning on installing any IDE or JVM until NetBeans 4.0 and Java 1.5 came out. So far it looks like necessity will tip my hand before that.
BTW anyone else hate the new icons in NetBeans 4.0? The gold “New File” icon is *WAY* too much bling-bling for me. Very nice IDE otherwise though, or at least will be when the bugs get ironed out.
Then the question is if Sun’s Java compilers is actually doing escape analysis, if it is smart enough to figure out all cases where escape analysis is applicable. And if it’s not implemented, then when will it be, considering the relative sluggishness of Java development by Sun.
I don’t know much about Java’s VM, so I really couldn’t say. The topic is pretty well-documented, and a number of available compilers implement it, so I don’t see any reason why Java couldn’t implement it. It might be the case that they don’t really consider speeding up user-defined types to be very important, given that Java has non-object primitive types, which makes the optimization less critical than it would be in languages where ‘int’ and ‘float’ are full objects.
Well in the CLR, primitives are full objects (everything is derived from object), but they are value types too. So you get the best of both worlds (that I know of), and no need to wrap primitives in wrappers to put into collections (pre java 1.5).
“BTW anyone else hate the new icons in NetBeans 4.0? The gold “New File” icon is *WAY* too much bling-bling for me.”
Well, personally, I don’t like Netbeans at all. But then again, I don’t really care for IDEs in general. Give me Emacs any day.
What I would really like, is a Java GUI designer similar to GLADE. ie. All I really want is something to make layout design easier which will then just export code that I can place into my source file. But so far I haven’t see anything anything like GLADE for Java. Oh well, maybe over winter break I will start an open source project myself that will basically be GLADE for Java.
Wrong subject in that last message. Sorry.
“Well in the CLR, primitives are full objects (everything is derived from object), but they are value types too. So you get the best of both worlds (that I know of), and no need to wrap primitives in wrappers to put into collections (pre java 1.5).”
No. You don’t get the best of both worlds. You take a performance hit during assignment because now you have to actually allocate and initialize an object.
Primitives as full objects was not a new idea. Smalltalk does this. Java’s designers chose not to, and I think the reason was performance.
“I don’t know much about Java’s VM, so I really couldn’t say.”
I am pretty sure that the Java VM does implement this, along with many runtime optimizations that it makes over time thanks to its runtime profiler.
No. You don’t get the best of both worlds. You take a performance hit during assignment because now you have to actually allocate and initialize an object.
Totally wrong. There’s no performance hit during assignment because you’re not allocating an object at all (don’t know where you came up with that one). It’s a value type and its just like a a java primitive or a c structure on the stack. The performance hit you get (and so does java, but in a different way) is when you add a value-type to a collection because it has to be boxed and unboxed when you add and remove from a collection. In java you have to instantiate a primitive wrapper for an object (pre-1.5).
By the way, Java 1.5’s generics are mostly a compiler trick. You won’t get a performance improvement with containers because its still objects under the hood. CLR 2.0 will actually construct a List of int (or whatever primitive collection you’re doing).
By the way, besides the garbage collection issue if Java’s compiler or VM isn’t doing escape analysis is the memory consumption of full-fledged objects vs. value-type at least in comparison to Java.
the tread are on java…
there are alway ms wannabe for talking about .net….
WAKE UP SIMBA, THE THREAD IS ON JAVA NOT .NET
@Lumbergh:
So you get the best of both worlds (that I know of)
Well, it’s not the best, because the programmer still has to make the difference between value types and reference types. And you can’t do stuff like inherit from a value type. C#’s type hierarchy in general seems a little wonky. It seems to be a step up from Java’s handling of it though.
is when you add a value-type to a collection because it has to be boxed and unboxed when you add and remove from a collection.
This cost is avoidable. If the compiler can prove only unboxed values will be inserted into a container, it can unbox the contianer. This eliminates the need to make a distinction between containers that are objects and primitive containers like arrays.
By the way, besides the garbage collection issue if Java’s compiler or VM isn’t doing escape analysis is the memory consumption of full-fledged objects vs. value-type at least in comparison to Java.
If you can prove a value doesn’t escape, and you can prove it’s type, you can elide the object header for it too.
@Simba:
Primitives as full objects was not a new idea. Smalltalk does this. Java’s designers chose not to, and I think the reason was performance.
It’s an engineering tradeoff between performance, flexibility, and implementation simplicity. You can have performance and flexibility, but at a major cost in implementation complexity. Java chose performance and implementation simplicity, at the cost of flexibility.
“the tread are on java…
there are alway ms wannabe for talking about .net….”
Um… Maybe you are the one who needs to wake up? Read the thread a little closer and you will see two things:
1. I am not the one that brought up .NET
2. I am defending Java and critisizing .NET.
So maybe in the future you should read the thread a little closer before you blow up at the wrong person. Ok?
If you can prove a value doesn’t escape, and you can prove it’s type, you can elide the object header for it too.
I’m pretty sure Java doesn’t do that. I remember at the end of Bruce Eckel’s video on Java 1.5 that there was a question from a research programmer from Lawrence Livermore-Berkley labs complaining about that facts that having all of those full-fledged objects around was a major pain in the ass for him. You can have all the theory you want, but unless its actually implemented then its irrelevant.
You make some pretty good arguments in favor of Escape Analysis! This is always something I wished .NET or Java would champion and bring into the mainstream (sorry, Lisp doesn’t count!)
It would be nice to have everything as a class and know that there won’t be some ungodly performance hit if I end up only using the class for a local scope inside of a function somewhere.
There are, I think, problems with this methodology, though, such as:
Class sally;
jim.pimps(sally);
jim.collectCash(sally);
jim.phatCash == //….?
How would the compiler know wheither to pass a reference to sally, or pass sally by a value that expires once the scope of the function is done?
I’m almost positive that Java doesn’t do this. My Lisp, Scheme, and Dylan compilers do, so what do I care My point is that if Sun or Microsoft were really interested, they could do it.
Java could have been great on the desktop. It could have made it simple to build cross platform applications that run well on Windows, Linux and others.
Unfortunately Java is only crossplatform as long as you run it on windows. As long as you can’t make full use of your keyboard on some platforms, java is not going to be a hit for desktop applications. This is the case if you run Linux. The Linux bug consists of that it is impossible to write dead keys on non US keyboards. On a Swedish keyboard it means that it will be impossible to write tilde, in other locales other characters will be affected. Even Solaris have had similar problems.
The bug have been around for over 4 years. In that time it have been closed unfixed at least one time. I guess it got embarrassingly high on the bugparade list.
As this bug is not fixed in the current releas candidate and that Sun states that they will delay even further, it seams that mono and .net have a better chance of being the cross platform tool of the future. You could of course still use java for development on windows, but I see little advantage in using a language that runs slightly slower than native applications and have minor deviations from the standard windows GUI for creating windows only applications.
If you think this should be fixed, you can vote for the bug at http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4799499
(requires free registration)
Other related bugs are:
4707542, 4765333, 4797332, 4799500, 4935357,…
I’m almost positive that Java doesn’t do this. My Lisp, Scheme, and Dylan compilers do, so what do I care
We since I doubt Lisp, Scheme, or Dylan are any faster than Java or C# then I guess it really doesn’t matter.
My point is that if Sun or Microsoft were really interested, they could do it.
Microsoft and Sun both have very bright engineers working on their compilers and runtimes. It seems that Sun’s problem is that they just don’t have the resources or just don’t care to implement them. I see very interesting things coming from CLR 2.0 and beyond (closures which you are interested in) etc…
@Lumbergh: Java has revived an interest in compiler optimization, carrying on the work that was done for Lisp. As such, there are a number of research VMs (eg: Jikes RVM) that implement such optimizations. I wouldn’t be surprised to see Sun implement this in future versions of javac.
@Shadowlight Dancer: If pimps() and collectCash() don’t store a reference to ‘sally’ in a heap object, then the compiler can stack-allocate the value and pass a reference. pimps() and collectCash() won’t notice the difference.
We since I doubt Lisp, Scheme, or Dylan are any faster than Java or C# then I guess it really doesn’t matter.
Unless Java and C# are faster than C, your doubts would be wrong. But that’s neither here nor there, right?
Microsoft and Sun both have very bright engineers working on their compilers and runtimes.
Both also have a lot of “NIH” syndrome. From what people have been saying in .NET articles, it seems to me that MS’s C# compiler is missing a lot of critical optimizations. I mean, Mono, which is a really simplistic compiler with a mediocre GC, is apparently comparable to MS’s .NET compiler in many cases.
Unless Java and C# are faster than C, your doubts would be wrong. But that’s neither here nor there, right?
Nahh. C is still faster than any of those environments.
Both also have a lot of “NIH” syndrome. From what people have been saying in .NET articles, it seems to me that MS’s C# compiler is missing a lot of critical optimizations. I mean, Mono, which is a really simplistic compiler with a mediocre GC, is apparently comparable to MS’s .NET compiler in many cases.
So I guess Microsoft should have adopted Java as its official desktop language? Yeah, right. Let’s have Sun dictate the direction of Microsoft’s desktop. Hilarious. Win32 and MFC are C and C++ apis. They didn’t invent those languages, but didn’t have any problem using them.
Mono’s compiler is written in C#. Microsoft’s compiler is written in C++ and is much faster than Mono’s compiler. Mono still has work to do to get up to .NET speed. Portable.NET’s compiler is written in straight C, but isn’t as fast as Microsoft’s compiler.
“So I guess Microsoft should have adopted Java as its official desktop language?”
No, but they could just have added a slew of JNI bindings to their distribution, instead of modifying the language.
Microsoft is actually modifying a language again! – they have added the ^ operator in C++ to flag a handle to an object on the managed heap.
Somehow I cant stop to think that they should have left C/C++ alone, and let C# do all the managed stuff!
oh, that’s funny . I have to work now an a paper of Dr. Brunot Blanchet, who analysed escape analysis for java. But the paper was written in 2000, so I cannot imagine that escape analysis has been implemented in the JIT. i also didn’t hear from that. That’s sad thought, because the benchmarks in his paper gave an average 20 % speed up.
Something else I wanted to say about Java .vs .NET : Of course JAVA generic or a compiler trick. But 2 important things about that :
1) You compability with earlier version of the jvm
2) It works.
It’s in fact slower, but hey … in java they are still so much things to optimize. Fully accelerate it for OpenGL, improve the garbage collector. Improve swing. Improve IO(??). I’m sure that even Java 1.9 will still bring speed-improvement. So, it’s not important that Java-Generic are “only a compiler trick and not implemented in the JVM itself”. It’s only a very little plus for .Net – and they have it only because they began .net later, then things like generic was already know by the mass.
The other effect of Java generics being all objects under the hood is that it you won’t be able to use reflection to rebuild objects.
You, me, and Microsoft are free to modify the language in anyway we feel like. It’s not a big deal. Managed C++ isn’t ANSI C++ anyway, but GNU and almost every compiler vendor add extensions anyway.
Agreed. But somehowh I cant help to feel that they’re teaching an old dog some new tricks – and I am not really sure that it is a good thing… IMO C# should be prefered over C++ when doing managed code. There are however probably some valid technical reasons for supporting managed code on C++. I just fail to see it.
@HelloWorld82, generics
“It’s only a very little plus for .Net – and they have it only because they began .net later, then things like generic was already know by the mass.”
Generics has been known for a loooong time – even prior to java! And using the “they arrived later, so can optimize stuff” argument is really really weak, since it doesn’t change the fact that they HAVE a faster generics implementation.
Yes, of course, it doesn’t change the fact that .net have a faster generics implementation. But … yeah. It’s only generic. That doesn’t decide a whole language. They are other things which are also important for java’s performance. And I really think that this kind of “hacks” like : “drawing everything with openGL” is at least as important as native generics.
And of course, generic were known before, but nobody really thought then, how important generics would be. Or do you think the people working for sun are more stupid as the ones working for microsoft? Ten years later, microsoft came, took all the work that have been done all that time by scientists, and put it together to form .net .
Sun is full of smart developers and “not changing the JVM” was probably the best decision to be made. They have their JVM, and a lot of developper are already using it, lot of application are allready written in java. It would been have mad to break compability between jvm’s, because then they would have lost the big advantage they have over .net : Their developer base. If sun would have begun Java now, they would also have put native generics in their language.
Finally : If you want to use language, which have really nice properties which allows you to develop faster, use polymorphic type, higher order functions, and powerfull pattern matching, take a look at O’caml or haskell. These language their developed to use all that features from the beginning.
p.s. : Sorry, but my english is really bad !
Tiger comes with global anti-aliased feature,
just turn it on by pass this parameter
“-Dswing.aatext=true” to the JVM.
after turn this feature on,
it has effects to every Java apps running on that vm.
you can see the snapshots here
http://www.narisa.com/forums/index.php?showtopic=5048
“It’s only generic. […] And I really think that this kind of ‘hacks’ like : ‘drawing everything with openGL’ is at least as important as native generics. […] And of course, generic were known before, but nobody really thought then, how important generics would be.”
Parametric polymorphism (aka templates, generics, etc.) is certainly an essential feature in statically typed languages. It is beyond me how language designers in the 1990s could decide that this should be left out of Java. Generics have been used since decades not only in academic circles but in production languages (eg. Ada has this feature since 1983). In contrast “drawing everything with OpenGL” does not affect your code but generics certainly do (for the better).
“Or do you think the people working for sun are more stupid as the ones working for microsoft?”
Probably not since both companies are driven by market forces and maybe that explains the common attitude that halfdone is good enough.
I totally wanted generics in Java for a long time, but then realized that I didn’t need them. The inheritence in java is quite good, and today I really don’t miss them at all. There may certainly be cases where they may be the clearest and easiest way to go, but that doesn’t seem to happen too often, at least in my experience.
I think one of java’s big problems was that it evolved more designed. It was originally just an embedded language. On the other hand .Net wasn’t designed as elegantly.
Haskell is an elegant language, I’d like to learn it better.
“Fully accelerate it for OpenGL, improve the garbage collector. Improve swing.”
In Tiger, everything can be fully accelerated for OpenGL. But it is disabled by default because so many graphics cards still have very buggy OpenGL implementations. But you can turn it on with a simple command line option, or from within your code.
I mentioned this in an earlier comment so I thought I’d share what I found from NetBeans site.
http://www.netbeans.org/community/news/index.html#488
—————————————————-
An updated NetBeans IDE 4.0 release schedule is now available.
September 30 – 4.0 Beta 2 Released Based on Beta 1 Feedback
End of October – High Resistance Mode
Mid of November – Release Candidate Build Testing
End of November – Customer Acceptance Survey Launched
Mid of December – Final Release Version
Mid of December – J2EE Module Collection
When they speed up your code by “a lot” then yes, generics are probably a good thing.
Sun is letting the JVM determine the evolution of the Java language, rather than technology available.
No matter how advanced the garbage collector is, you can’t get away from the fact that cleaning up all those objects is going to cost more than a simple stack pointer move.
The generational GC in Java 1.5 is optimized for creating lots of short-lived objects. In the past, we as Java programmers were told to use fewer, longer-lived objects. This is no longer good advice. With the 1.5 GC, LIVE objects cause a performance hit, as they are copied from one area to another. Dead objects go away automagically, because they are not copied.
[quote]
Tiger comes with global anti-aliased feature,
just turn it on by pass this parameter
“-Dswing.aatext=true” to the JVM.
[/quote]
YES!
(I apologize for the one-liner)
FYI, the name of the author is Chet Haase, not Hasse.
Java and .NET don’t have the same driving force behind them. Java and the JVM were designed to be platform neutral, where else .NET’s intend is it to be easy portable between platforms (note the slight difference).
Anyway from my point of view it looks like, that java wasn’t originaly intendet to have e gui part. From what I once read it seems that AWT was quite a sluggy hack. Unfortunately it got popular.
Java and .NET don’t have the same driving force behind them. Java and the JVM were designed to be platform neutral, where else .NET’s intend is it to be easy portable between platforms (note the slight difference).
care to elaborate on the difference? it seems like a difference in quantity rather than quality to me.
Java: “Java is the platform, there is no other! Your Java should not touch the evil, filthy operating system beneath.”
.NET: “If you’ve got it, flaunt it – ride the operating system for all its worth until that puppy can’t even pant anymore.”
There are two seperate philosophies: Java heavily inclined to, “write once, run anywhere”; .NET was created with the potential ability to easily invoke platform-specifics in mind.
bact’ wrote:
> Tiger comes with global anti-aliased feature, just turn it on
> by pass this parameter “-Dswing.aatext=true” to the JVM.
> […]
> you can see the snapshots here
> http://www.narisa.com/forums/index.php?showtopic=5048
I think that looks quite ugly. I think antialiasing text makes it way too blurry. I prefer sub-pixel rendering (on LCDs), but if that’s not available then I’d rather have normal text than antialiased.
You’re joking right.
Must be your monitor.
On an apple laptop, in Safari, the anti-aliased text looks excellent.
Beginner wrote:
> You’re joking right.
Me? No, I’m most certainly not.
> Must be your monitor.
Uh… no.
It’s not exactly bad on my 1400×1050 laptop screen (since the pixels are so small), but I’d still rather have normal than antialiased text. Since antialiased text is blurry the eyes try to focus all the time. Normal text is much easier on the eyes.