Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Maes

Any Java source ports in the works?

Recommended Posts

Because of my more-than-healthy daily contact with Java (due to my thesis), and the focus of my work on "high performance Java", I wondered whether any there are any pure Java source ports in the works, or already working.

Also....what engine is the Doom RPG using? It looks more like a buffed Wolf3D engine than a scaled down Doom engine...yet I'm sure that by applying 10 years worth of optimizations, a lo-res Doom renderer at a reasonable frame rate should be possible on a MIDP 2.0 Java enabled cell phone...

Note: please don't flame me regarding Java performance issues...yet

Share this post


Link to post
TheDarkArchon said:

Simply put, no there's not. The Doom engine relies on the way C handles things.


Well, this fact alone isn't a hindrance for porting to Java: C-like pointers and pointer arithmetic can be sort of emulated in Java with the use of references and manual array handling, in order to follow a C program closely, although certain things that are guaranteed to be high-performance fire-and-forget in C/C++ are not likely to be so in Java (ask me...I know :-( )

And...somehow they came out with a 3D engine for the Doom RPG, although it looks more Wold3D-ish

Share this post


Link to post

According to some video i saw a while back, Doom RPG's engine was written from scratch by Carmack in Java.

Share this post


Link to post

The Doom RPG is indeed in Java.

And uh, I don't even want to imagine Doom written in Java.

Share this post


Link to post
HobbsTiger1 said:

The Doom RPG is indeed in Java.

And uh, I don't even want to imagine Doom written in Java.


Why not? The engine the guy on the STARK page wrote works wonders as an applet, a reasonably downscaled version applying all known optimizations (e.g. from fraggle) is definitively possible even on a mobile phone: just imagine the Doom RPG engine but used in continous mode :-)

Even with flat coloured floors, it would be t3h h4x. Plus, by cleverly using primitives instead of standard lbraries, significant speed increases can be obtained.

Share this post


Link to post
HobbsTiger1 said:

meh. Doesn't matter to me anyways, as my PC is a JRE free machine

What do you have against JRE?

Share this post


Link to post

It's a big piece of bloat that's stealing memory for almost nothing. It's just too bad when you need it for certain things. I'd like to eliminate it from my HD as well...

Share this post


Link to post

Java doesn't use any memory unless you set it to start when Windows does, or if you open a page with a Java applet in it.

Share this post


Link to post

That's quite different. Don't forget that a game like Q2 spends a lot of time inside system libraries, most importantly OpenGL and that it defers a lot of work to the graphics card. Doom on the other hand is doing all the rendering with the CPU and doing such code in an inefficient language like Java will never perform well even though today's faster CPUs won't make it that apparent.

Share this post


Link to post
Graf Zahl said:

That's quite different. Don't forget that a game like Q2 spends a lot of time inside system libraries, most importantly OpenGL and that it defers a lot of work to the graphics card. Doom on the other hand is doing all the rendering with the CPU and doing such code in an inefficient language like Java will never perform well even though today's faster CPUs won't make it that apparent.

Performance problems don't exist unless they affect the user. If CPUs are fast enough to do it, then there is no problem.

Share this post


Link to post

...and that attitude is responsible for modern software that eats considerably more resources for less performance than 10 year old programs.

Of course all those modern programmers who are used to wasting CPU time won't be able to write fast code when it is actually needed as well. The company I am working for has real trouble finding good programmers. Since we are developing for systems with limited resources (e.g. cell phones) we have absolutely no use for such an attitude - but today everybody is so used to it that they are incapable to program in a more efficient manner.

Share this post


Link to post
Graf Zahl said:

That's quite different. Don't forget that a game like Q2 spends a lot of time inside system libraries, most importantly OpenGL and that it defers a lot of work to the graphics card. Doom on the other hand is doing all the rendering with the CPU and doing such code in an inefficient language like Java will never perform well even though today's faster CPUs won't make it that apparent.


So what you're saying is that something like GZDoom would run well if ported to Java, assuming it was run in hardware accelerated mode?

Graf Zahl said:

Since we are developing for systems with limited resources (e.g. cell phones) we have absolutely no use for such an attitude - but today everybody is so used to it that they are incapable to program in a more efficient manner.


That's a pretty bad example. Plus, it's just as easy to write inefficent C++ code as it is to write inefficent Java code. Granted, C++ doesn't have to deal with the additional overhead of a runtime environment, but if pure code efficency was such a problem we would still be coding everything in pure assembler. Bytecode-compiled languages that use virtual machines such as Java and C# have uses, just as compiled languages such as C++ and low-level languages such as assembler have uses as well. You're trying to compare apples to oranges here.

Share this post


Link to post
Graf Zahl said:

...and that attitude is responsible for modern software that eats considerably more resources for less performance than 10 year old programs.

Your attitude is responsible for buggy and insecure software :-) This ridiculous obsession with imagined "performance" where it isn't necessary is why people continue using C/C++ even though we now have much better languages at our disposal - and still we're stuck with software that leaks memory and is full of buffer overflow vulnerabilities (over 17 years since the buffer overflow exploit was first identified).

Of course all those modern programmers who are used to wasting CPU time won't be able to write fast code when it is actually needed as well. The company I am working for has real trouble finding good programmers. Since we are developing for systems with limited resources (e.g. cell phones) we have absolutely no use for such an attitude - but today everybody is so used to it that they are incapable to program in a more efficient manner.

Programmer time is the most expensive of all resources.

In your particular situation (embedded development), you are fighting limited memory, so more careful use of memory is needed, but this isn't something that most application programmers need to worry about. In fact, I consider needlessly worrying about performance to be incredibly harmful - it leads to poor choice of tools (C/C++ over high level languages) and microoptimising code in ways that the programmer imagines will give better performance, at the expense of readability.

I've written C code for about 10 years now, and having used much nicer languages, I know just how much of my time it wastes. In a recent C project, a teammate and I estimated that 30-50% of all the code in the source was related to checking return codes for error conditions - code that would disappear if the language supported exceptions. C++ isn't much better. I dread to think how much time I've wasted over the years thinking about memory management nonsense. Aren't computers supposed to be tools made to serve us, not the other way round?

I'm not saying that we should just get rid of C altogether - there are some places where it is simply can't be replaced. But the "C programmer's disease" of constantly worrying about performance all the time drags people into using it where it isn't necessary and causes more harm than good.

You still haven't answered my original point, anyway - you say yourself that modern CPUs won't make it apparent: in which case, why not use Java?

Share this post


Link to post

fraggle said:
Your attitude is responsible for buggy and insecure software :-) This ridiculous obsession with imagined "performance" where it isn't necessary is why people continue using C/C++ even though we now have much better languages at our disposal - and still we're stuck with software that leaks memory and is full of buffer overflow vulnerabilities (over 17 years since the buffer overflow exploit was first identified).

All this blabbering about 'better' language ist nonsense. A program is only as good as the written code - not the language. Personally I don't like high level languages at all and avoid to use them whenever possible. Java is a great example of a language that has been amputated enough so that efficient code is no longer possible in many scenarios that require complex data structures and higher level languages are often worse. It makes me sick that my 512MB computer is currently barely able to handle tasks that ran without problems on 64MB systems a few years back with contemporary software.

In your particular situation (embedded development), you are fighting limited memory, so more careful use of memory is needed, but this isn't something that most application programmers need to worry about.

But due to an attitude you so eloquently represent we are unable to get good programmers. The current attitude seems to be 'Let's burn all the performance for nothing so we don't have to think about good programming'.

In fact, I consider needlessly worrying about performance to be incredibly harmful - it leads to poor choice of tools (C/C++ over high level languages) and microoptimising code in ways that the programmer imagines will give better performance, at the expense of readability.

Agreed. But not worrying about performance at all leads to sloppy implementations and inefficient algorithms. The main problem is not microoptimization (which IMO is an utterly pointless and counterproductive task) but careless programming.

I've written C code for about 10 years now, and having used much nicer languages, I know just how much of my time it wastes.

I have written C code for 18 years now and C++ for 14. I still haven't found a better language. Java most definitely isn't it and I wouldn't voluntarily work with it ever.

In a recent C project, a teammate and I estimated that 30-50% of all the code in the source was related to checking return codes for error conditions - code that would disappear if the language supported exceptions.

Strange. All the Java code I know is full of exception handlers because the language forces me to handle them. If I could just check the return code in many of those cases my code would be considerably shorter. I reserve use of exceptions to situations that have to be considered abnormal (like failure to allocate memory) and that I don't want to handle in the places where they might occur.

C++ isn't much better. I dread to think how much time I've wasted over the years thinking about memory management nonsense. Aren't computers supposed to be tools made to serve us, not the other way round?

I'd rather think about this myself than making me a slave of a memory wasting garbage collector. And besides, a good programmer can write nice and clean C++ code without major problems. And memory leaks can also occur in high level languages. All you need is a data structure that can 'forget' about data without clearing all the references to it

I'm not saying that we should just get rid of C altogether - there are some places where it is simply can't be replaced. But the "C programmer's disease" of constantly worrying about performance all the time drags people into using it where it isn't necessary and causes more harm than good.

Still preferable to seeing software that runs like a snail. Good example: Visual C++ 2005 vs. Visual C++ 6.0. I find it amazing how large the performance degradation and increase of memory consumption are between these versions. The new one uses 5 times as much memory and runs slower on a modern machine than the old one on a system that was up to date in 1998 when it was released.
And since this seems to be the general trend with software I am really, really worried.

You still haven't answered my original point, anyway - you say yourself that modern CPUs won't make it apparent: in which case, why not use Java?

Because IMO Java is shit. The language doesn't suit my programming style and is missing some features I'd like to have.

Share this post


Link to post
Graf Zahl said:

Because IMO Java is shit. The language doesn't suit my programming style and is missing some features I'd like to have.

I'm glad you admit the real reason :-)

Share this post


Link to post
AlexMax said:

So what you're saying is that something like GZDoom would run well if ported to Java, assuming it was run in hardware accelerated mode?

No. Unlike the Quake II engine, the Doom engine is not polygonal by nature so before the map is sent to OpenGL for rendering, it has to be converted to polygons.

Share this post


Link to post
TheDarkArchon said:

No. Unlike the Quake II engine, the Doom engine is not polygonal by nature so before the map is sent to OpenGL for rendering, it has to be converted to polygons.

Worse. Due to the semi-dynamic nature of the map's geometry it isn't enough just to create the polygons once. You have to re-check them every time something in the map changes. Currently the engine isn't even doing that because C++ is fast enough to recalculate them each frame from scratch. But that's something you can't afford in an interpreted language.

fraggle said:

I'm glad you admit the real reason :-)

At least I see Java for what it is: Something best avoided when writing real software. :D

AlexMax said:

That's a pretty bad example. Plus, it's just as easy to write inefficent C++ code as it is to write inefficent Java code. Granted, C++ doesn't have to deal with the additional overhead of a runtime environment, but if pure code efficency was such a problem we would still be coding everything in pure assembler. Bytecode-compiled languages that use virtual machines such as Java and C# have uses, just as compiled languages such as C++ and low-level languages such as assembler have uses as well. You're trying to compare apples to oranges here.

No, I am not. I'm not talking about choice of language here. Many of the devices we target run only on Java so we have to use that. However, all the programmers we interviewed in the last 12 months were utterly incapable of writing code that performs well and is sufficiently fast on such platforms. They are all so hard wired to spread their data throughout as many structures and classes as possible that it its impossible to make them understand why a completely different approach is needed here.
Especially when using Java you simply can't afford to create new classes for every piece of data you want to organize. And here's the ultimate example where Java's rigidness causes it to shoot in its head: If you want to write clean and readable Java code you create such an amount of redundant data that many phones can't handle it anymore. The language is fundamentally incapable of creating efficient code for these platforms. To get something usable here you have to resort to code that is worse (in fact considerably worse) than your average C or C++ code. Needless to say that the susceptibility to bugs is also considerably higher with such code.

Share this post


Link to post

Yawn. You can't get good programmers for the same reason that despite your assertion that by-hand memory management isn't a big deal, software is rife with memory leaks. Good programmers simply do not grow on trees.

Share this post


Link to post

One of the main reasons java is so disliked is because people never really bothered to give it a chance.
its a language that gets compiled into bytecode so it can run on almost anything that has a VM, this is one benefit java has over almost anything else.

When swing was introduced, everyone thought it was the most horrible looking interface every known to man, this is the reason why java got another rather large nail in the coffin.
You're right, swing is ugly, but java itself is a fine language.

Yes. there is a certain amount of bloat, but other OOP languages like C++ and some weird dialects of basic also have this problem.

Share this post


Link to post
RTC_Marine said:

One of the main reasons java is so disliked is because people never really bothered to give it a chance.
its a language that gets compiled into bytecode so it can run on almost anything that has a VM, this is one benefit java has over almost anything else.

John Carmack said:

Write-once-run-anywhere. Ha. Hahahahaha.

John Carmack also said:

Portability is not a justification for the awful performance.

Share this post


Link to post

If the truth be told, I'm not convinced that Java is entirely appropriate for mobile phones, I've read Carmack's comments on it in the past. However, it's worth realising that there is no one language appropriate for all situations. For the majority of applications - eg. desktop programs, it's far more suitable than other languages such as C and C++.

The obvious question to ask at this point is: if C/C++ is so great, why isn't it used in server-side code on websites?

Share this post


Link to post

RTC_Marine said:
One of the main reasons java is so disliked is because people never really bothered to give it a chance.
its a language that gets compiled into bytecode so it can run on almost anything that has a VM, this is one benefit java has over almost anything else.


Nonsense. People dislike Java because it has removed lots of useful features but offering little in return. Sure, the memory management may be a little better but that's it. Performance of Java is utter crap and portability even worse. John Carmack is absolutely right.

When swing was introduced, everyone thought it was the most horrible looking interface every known to man, this is the reason why java got another rather large nail in the coffin.
You're right, swing is ugly, but java itself is a fine language.


That can be said for any API that exists for Java. Sun is utterly incapable of defining something robust and useful. It's all technocratic mega-crap that has never been properly tested before release.

Yes. there is a certain amount of bloat, but other OOP languages like C++ and some weird dialects of basic also have this problem.


Code bloat is not a feature of any particular language but always of programming style. Rigid OOP approaches always tend to create larger code than necessary.
But with Java the problem (especially on cell phones) is that if you have 10 classes you have 10 symbol tables for imported references and no means to get rid of them. That's a lot of redundant and ultimately useless data that wastes valuable space.

Share this post


Link to post
fraggle said:

if C/C++ is so great, why isn't it used in server-side code on websites?


Cross-platform compatability and lack of trust are two things I can see right off the bat.

Share this post


Link to post
fraggle said:

If the truth be told, I'm not convinced that Java is entirely appropriate for mobile phones, I've read Carmack's comments on it in the past. However, it's worth realising that there is no one language appropriate for all situations.


Most definitely not and here I can talk from 3 years of professional experience. Worse, the J2ME specification for the API is so unclear about many things that each manufacturer implements it differently and compatibility is more or less a big joke.

For the majority of applications - eg. desktop programs, it's far more suitable than other languages such as C and C++.


Sorry, but no. If the language was at least flexible enough to target a real platform instead of Sun's shitty JRE it might be different but here's something I simply don't trust the least that gets in the way. I'd rather use C++ with wxWidgets. At least that has an intuitive interface that is usable - and it creates native applications that don't require installation of a 30MB piece of baggage.

Oh, and particularly regarding Windows: Java is useless as an application development language because it opens a console window for each app you start. Too bad that you can nuke any application from such a window with just 2 keypresses - and the application can't do shit about it. And knowing that Sun will never fix it that alone is reason enough not even to consider it.

The obvious question to ask at this point is: if C/C++ is so great, why isn't it used in server-side code on websites?


I think you answered that particular question yourself above:

'However, it's worth realising that there is no one language appropriate for all situations.'

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×