Michal S. wrote:
Free if you happen to have the right platform …
Yeah, if your platform is Linux, Windows, or Solaris…that’s a pretty
wide selection. And these days, there’s Sun and non-Sun builds for BSD
flavors, OS X, and plenty more.
The Java 5 documentation used to have very onerous license. Have you
ever read it? Maybe the newer ones are better. I heard that Java 7
will be GPL but we are not there yet.
Java 7 is GPL. The only pieces that aren’t are the ones Sun had no
rights to GPL, and they’re in the process of being replaced with bits
from e.g. GCJ.
Where is a complete Java 5 implementation other than Sun JVM? With the
GUI stuff and all? Everywhere I always see “Sun JRE required”. Sure
the situation would be different for server stuff or other
applications where the fancy GUI is not required.
IBM has had complete Java 5 implementations for a while and now has a
Java 6 beta out: IBM Developer
BEA has Java 5 and Java 6
implementations:http://dev2dev.bea.com/jrockit/
Apple of course has complete implementations of Java 1.4, Java 5, and
non-public (any more, at least) betas of Java 6
Apache has milestone builds of Harmony 5.0: http://harmony.apache.org/
And there are a number of in-progress but working ports of the Java 6
research-licensed source and the GPLed Java 7 source.
All of these have GUI support. And I know that Sun’s, IBM’s, BEA’s, and
some of the other FOSS impls can run JRuby. Hell, JRuby on Rails can run
on a mainframe running Z/OS using one of IBM’s JDKs, and still talk to a
Microsoft SQL Server database without modification. Do you want more?
When we are talking about Swing frameworks it is something Java, and
probably even Sun JVM specific. How can you abstract Java out then?
I think “probably” is the key word here that you’re missing a lot of
facts. Swing is nowhere near Sun JVM specific. It’s supported by any
Java SE implementation, and I’ve already listed several. Where are you
getting this information?
And Swing is just an API. Sure, it’s written in Java. But it’s just
bytecode in the end. From Ruby, it’s just classes and methods:
frame = JFrame.new(“Some title”)
button = JButton.new(“Press me”)
frame.set_size 300, 300
frame.always_on_top = true
frame.add button
button.add_action_listener { button.text = “Pressed!” }
frame.show
This is all plain old JRuby code, and can be packaged up WITH JRuby in a
single file that runs on any Java 5+ implementation without rebuilding
or repackaging in any way. How is that not cool?
Specifically with libc some common systems allow to install several
libc version, and the right is picked for running the application.
However, Java application for different version of JVM just breaks.
I have five Java SE versions installed on my machine. Four are from
Apple and one is a port of the Java 6 source. I switch between them
freely. Sure, if I compile for Java 6 and try to run on Java 4, it will
break; that’s by design, so I can write to Java 6 APIs and know that if
the app starts up it has guarantees about compatibility across all APIs.
And a user only needs to know one version number to be sure the app will
run rather than having to track a dozen library versions potentially
incompatible with each other or their own past versions.
And backward-compatibility on the Java platform is far better than
almost every other platform I’ve used; even Ruby 1.9 is going to break
many uses of String, block arguments, and other features (for the
better, I must say). Perhaps it’s a matter of opinion when a bad API is
fixed as to whether it’s a good fix or a breaking change; but that’s no
different from any other platform.
But I think we’re getting too far away from Ruby here. You’re set in
your ways and not going to change your opinion or give the Java platform
another chance. I can sympathize with folks who’ve been burned by the
platform; I lived through those days as a Java developer, which is a
large part of the reasons why I work on JRuby. But times change, and the
platform hasn’t stood still. If you continue to live with outdated
prejudices, you’re going to miss out on an outstanding VM. And in my
opinion, you’re going to miss out on a great implementation of Ruby as
well.
Do as you will.