[clug] Why isn't Java popular on the Linux Desktop?

Michael Cohen scudette at gmail.com
Sun Jul 19 06:22:32 MDT 2009


On Wed, Jul 15, 2009 at 6:11 PM, Hugh Fisher<hugh.fisher at anu.edu.au> wrote:
> A further annoyance is the Java Native Interface for calling
> platform native C code, which seemed to be expressly designed
> to discourage you from doing so. (Microsoft evidently took
> notes because in C# it's much easier.)

And therein lies the biggest problem IMHO. Lets face it portability is
like world peace - we can dream it but it just cant happen. For the
simple reason that portability means reducing all systems to the
lowest common denominator. We have a hugely complex and efficient
operating system right there, but if you write in pure java you cant
use it - just a simplified and dumbed down view of what an OS should
provide.

For example, linux provides lots of services like mmaped files,
inotify, and lots of libraries as shared objects. Most of the code in
a GUI app should be just to present an interface to these libraries
who do the hard work.

I have used python for a long time, and I particularly like its C
interface (and ctypes is nice too). For computationally intensive
programs most of the execution time is spent in C anyway. It does not
make sense to implement complex algorithms in pure java or python - I
just cant sacrifice the performance. But if I can use python to tie
all the C code together in an OO way that makes my code much simpler
and more maintainable. If you use high level languages as glue its
even more important to have strong autoconf support.

Python is not perfect either - for one thing I hate distutils - this
monstrosity tries to reimplment autotools very badly - As long as you
code is in pure python its ok, but as soon as you try to add C code to
your project it runs out of steam. The reality is that a large project
can be written in several languages and may optionally depend on many
libraries. Autoconf/automake are the tools for this job to tie all the
different component together.

The whole point is that portability is not really what you want anyway
- you want to take full advantage of your platform - otherwise you may
as well write your code for windows 3.1 which could be the lowest
common denominator. I guess it depends on what your application is
doing.

Michael.


More information about the linux mailing list