And so it begins.... ! (Sun makes play...)

Okay. So, a lot of what this new group is about is listening to game developers and getting things moving in the right direction for them. We have a lot of ideas about what needs fixing, but we would like to see our list validated and updated with input from all of you.

So, what do you want to see fixed? (With a new #2 pencil sharpened in hand)

Doug.

PS - Cas, we know about structs. :slight_smile:

LOL ;D

So, what do you want to see fixed? (With a new #2 pencil
sharpened in hand)

1.4.2 Beta brought some much needed performance improvements. It is now feasable to do 2D at resolutions higher than 640x480. So I guess I’d say, keep that working, make improvements to what is hardware accelerated by Graphics2D (i.e. primitives like boxes should be accelerated), MAKE FULL SCREEN WORK FOR X11!!!, and fix JavaSound. JavaSound I think is a bit embarassing. Here you have an API that’s capable of awesome sound manipulation, it’s based on HeadSpace which has support for everything from wav to MOD XM/S3M files, yet the volume control doesn’t even work!

Thanks for asking tho. :slight_smile:

  1. Combine the server and client VMs so we get faster startup followed by even faster running.

  2. Provide a CDC J2ME profile based on this hybrid VM. Chuck out everything that’s not necessary to make a VM execute bytecodes. Add everything else as optional packages. Adjust license to suit this arrangement.

  3. Fold in those VM startup improvements that Apple have sorted out.

  4. Don’t be providing any APIs as ā€œstandardā€ like ImageIO or JavaSound. Let the community come up with APIs to solve problems instead of choking them off with a bloated alternative.

  5. Add special feature that gives me £100 every time someone creates a new Thread and then complains when their animation runs weirdly.

Cas :slight_smile:

I’d like to see lightweight objects in Java. And by this, I don’t mean the structs proposal on the bug parade. I just want to get rid of the cost associated with temporary objects. I’m tired of making my code ugly to avoid doing news. Even if the GC ever gets fast enough that doing news of temporaries is a non-issue (it isn’t there now), you still have the problem that following references is cache-unfriendly. For example, if I have

class A {
float v1;
float v2;
float v3;
}

I know that once I reference v1, v2 and v3 will also be loaded in the cache so accessing them will be fast. However, if I have

class A {
Vector3f v1;
Vector3f v2;
Vector3f v3;
}

I’ll be jumping all over memory accessing v1, v2, and v3. I want v1, v2, and v3 to be inlined in memory just like primitives are. I want to not have an 8-byte per object overhead, just like primitives don’t have. I don’t want to be able to extend v1, v2, and v3, just like I can’t extend primitives. I don’t even want operator overloading. I want lightweight objects.

I think everything is wonderful.
No changes needed.

Herk wins!

-SG

Improve the native code already used in the JRE. For example the JPEG decompressor and software blitting with alpha mask can all be accelerated significantly with SIMD instructions.

Reduce garbage generation inside the JRE, or the need to make temproary objects or copies to work with the existing APIs… e.g. sometimes data from a Direct Byte Buffer must be copied to an array so that it can be passed to other APIs (e.g. JMF, ImageIO)

Improve JMF. It doesn’t work that great or get much support from Sun… but has great potential. It could be used to send voice chats to other players in a networked game, play cutscene animations, etc.

I think I disagree with Cas’ #4… The rich set of APIs is part of what attacted me to Java. If they aren’t part of Java they won’t get ported (because it won’t be ā€˜required’)… if they don’t get ported, there goes WORA. But I agree that there needs to be provisions to include only parts of the JRE, particularily if you are installing it only as a private JRE for your application, and not a system wide JRE. Extend WebStart to handle automatic installation of JRE subcomponents to the JREs that it is aware of. That way my WebStartable game can specify what APIs it needs and if the user doesn’t have a full JRE they will only get what is required by my program… the next program may use a different API and WebStart will only need to download that small subcomponent before the program can run…

Finish the support for hardware accelerated 32-bit sprites.

As above Improve JavaSound (all of JMF actually)

Make a place to register codecs with java.sun.com for JavaSound, JMF, ImageIO… make sure there is a link from the JavaDocs to those registered lists. (e.g. someone reading about Java Sound should easily find a link to the Ogg Vorbis codec)

That’s all I can think of at the moment…

Wow, this really sounds incredible. Can’t wait to see what happens next. I imagine something amazing is planned for Java One this year… Any hints?

-Z

The worst problems in my last, quite comprehensive, Java3D project had to do with the JMF, Java Sound and Java3D sound integration, as well as integration between JMF and Java3D rendering. A robust sound implementation that works well with all the other media APIs would be a great improvement.

Another problem that came up on the horizon but never really affect my project in a serious way was again the lack of extensability in Java3D (specificly, the lack of shaders), but we all seem to be painfully aware about that one.

Better tool integration to support the graphics content pipeline would be nice, but the Xj3D folks seem to be doing a great job in that area and now it is mainly up to the 3D-modeller companies to start supporting X3D in a serious way.

I would hate to see Sun drop the productivity focus for Java and stop supporting libraries though, even if the libraries that are provided should be made more open and extensible. My most recent project is a great testament to Java and Java3D’s productivity. I modelled a virtual world in Maya, built a new physical interface, scripted and recorded cutscenes and dialogue, wrote a 3D-engine etc. in just nine weeks, much thanks to all the APIs provided by Sun and the Xj3D group.

How about the ability to overload operators, like in C++? That is the feature of C++ I miss the most.

[quote]How about the ability to overload operators, like in C++? That is the feature of C++ I miss the most.
[/quote]
There are two problems with operator overloading - syntax and value objects. You can have operator overloading with java by using one of variant java compilers - kiev for example (althrough it is a bit outdated, it still supports a lot of interesting possibilities, like mentioned operator overloading, multiple inheritance through delegation etc).

Real problem is cost associated with creating new object every time you use operator. It cannot be resolved without lightweight objects or really smart immutable object/escape analysis and until then, operator overloading will not be suitable for high-performance math - and IMHO, math is only area where you really need it.

Please check out
http://java.sun.com/people/jag/FP.html#overloading

LWJGL in the Jre and swing/awt optional ;D ;D

Ditto; the fact that Java started off with ā€œstandard librariesā€ whereas C and C++ had to wait a looooong time before getting them has IMHO had a huge but subtle positive effect.

In fact, my only truly catastrophic problems with supporting java applications have always been caused by failure (of a JVM author) to do the standard libraries properly. One example is Apple (and a few other platforms) JVM’s which only included parts of the standard libraries - in the end, I usually persuaded my employers to stop supporting Apple entirely, for the simple reason that the cost-benefit ratio was far far too high.

The other obvious example is the massively irritating state of Fullscreen mode. Releasing 1.4.x with the new fullscreen API, but without support on major platforms (unix, linux) must be having a bad effect. Just look at the number of people who state ā€œI’m not doing a fullscreen version of my game/app because it doesn’t work on all platformsā€. I’m not complaining - just trying to point out how much pain comes about when a ā€œstandard libraryā€ isn’t actually a complete standard.

This must surely be one of the most popular sensible suggestions. I just want to add that - if you follow this route - please be very careful to make it a VERY good packaging/deployment/versioning system. Linux, for example, is suffering hugely these days because of the widespread use of RPM, and the major failings in that deployment system.

I know from experience that a really good packaging system is much like a really good Data-Structures library - it takes a lot of thinking and planning to get just right, but the payback is felt again and again and again for many years to come. Positive or negative. These systems really need a lot of effort, and typically you can’t make big changes later on if you realise you did something badly.

Authoritative, UP TO DATE, documentation (probably in the form of tutorials) on the subtle, low-level issues. The BufferStrategy documentation is a good start, but it doesn’t go far enough. If you take those docs, add in everything that Jeff has said on JGO on that topic, add in the comments by the guy in the Java2D team about some of the experimental hardware support in 1.4.x, add in some of the comments by people on JGO, and you get the right level of docs.

The typical problem here is that if you are trying to use all the advanced graphics stuff ā€œproperlyā€, it is very hard to get it right first time. There are so many subtleties (e.g. ā€œthis isn’t implemented on linux yetā€) and unanswered questions (e.g. ā€œcan I use Swing and AWT components with fullscreen mode? Are the problems I’m seeing my fault, or because of some incompatibility?ā€).

Obviously, we’ll have all those SPECIFIC examples cleaned up pretty soon. However, with each new release and API, if you are pushing hard at the boundaries of what is included in Java (e.g. adding a full OpenGL pipeline in 1.5 from scratch), the same kinds of problems will recur. If the release notes for each version were about 10 times as detailed, this wouldn’t be a problem. If the API documentation were perfect, this wouldn’t be a problem.

But we live in the real world, so I’d be happy with a subsection of JGO which was just an up-to-date FAQ on these gotchas. Searching JGO forums, and reading hundreds of posts to find a gotcha (the only way I currently know of dealing with these problems!) everytime you THINK you may have found one is far too time consuming.

[quote]How about the ability to overload operators, like in C++? That is the feature of C++ I miss the most.
[/quote]
I’m not trying to be facetious, but ā€œjust because you miss it, isn’t a reason for porting itā€.

There are damn fine reasons not to have operator overloading (and, of course, good reasons for having it - although I’ve been convinced over the years that the former outweigh the latter).

…but if you’ve got a really good reason for having it, then illuminate us (unless you were just trolling ;))

Number one reason for not having it:

Code maintenance often becomes much more expensive, because you have a much poorer concept of what, precisely, is happening when you read the code.

This is strongly related to some of the good reasons for doing away with header files and compile-time includes: reading and comprehending source code quickly becomes an exercise in remembering things, or fast-switching between lots of source files, just to read one of them; encapsulation typically flies out the window, and most of the advantages that go with it.

Blah blah blah…good programmers don’t make these mistakes…blah blah. But that’s what they said about BCPL, and typeless languages. I haven’t yet met the developer who would prefer NOT to have a compiler which was able to automatically catch programming errors (apart from Martin Richards, who is still in love with BCPL, all these years later :frowning: ).

[forgive the gross generalizations, in an attempt not to wander too far off topic, and into the wastelands where the Trolls live…]

Overloading operators can be a nightmare for maintenance, since you loose consistancy when reading code, however the same can be said when you start getting badly named methods, or methods that have subtle but vital side effects which arn’t immediatly obvious when looking at the method signiture.

Just because some people can abuse overloading, doesnt justify their total removal. I can write bad code with or without this feature :wink:

Likewise, what about this:


String head = "Some text";
String tail = "more text";
String list = head + tail;

So, what is that except operator overloading? I doubt you’ll see people complaining about the readability with this (especially vs. the fully expanded form generated with chained string buffers). This is clearly a special case, and so breaks consistancy. </devils advocate>

I don’t particularly mind either way, but whatever the decision is, make it consistant!

Indeed. I have a vague memory of finding a bug in someone’s code for them, that was cause by the plus overload for String’s, but I’m not sure; seems very unlikely :).

EDIT: I remember now. Just irritating problems that prevent compilation…You cannot do:


    int x, y;
    String s;
    System.out.println( "something: "+s+", and x+y"+ x+y );

You have to bracket the x+y, to make the compiler interpret that plus as an integer plus, rather than a String concatenate. Minor irritant.

I have also seen problems when the implicit call to ā€œ.toString()ā€ doesn’t happen. The call is normally triggered by the use of a non-String with a String-concatenate-plus, but if you pass an Object to a method that takes a String argument, the conversion doesn’t take place. This is kind of weird for some people, because the get used to the fact that you can insert an Object where a String is expected, and that the implicit call will ā€œjust workā€.

However, I have seen MANY major bugs because of java’s op-overloading for arithmetic on basic datatypes. The most common one is, of course, the difference between integer divide and double divide. It’s rational to overload float and double divide to be the same, but I frequently see people doing something like:


   int x = 1; int y=2;
   double d = x / y;

and being screwed by the unexpected value of 0.0d. Sigh. And this is a trivial example that you can learn to avoid by rote…things can get much worse if you add general overloading.

(Of course, the actual code has the variables separated up much more, and it is less obvious what the problem was!).

What really really irritates me about this example is that javac will refuse to compile (which is a whole separate stupidity: compiler warning? yes please … refuse to compile? Please, NO!) if it thinks I didn’t actually want an automatic cast for this:


    float f = f * Math.sqrt( f );

when I often do want the cast, but WILL NOT do the same behaviour for the painfully common accident I highlighted above.

Ditto the stupid stupid stupid bug whereby:


    Object i = null; // you HAVE to explicitly reference null, or it won't compile
    // do something with i

is forced upon you by the compiler because otherwise it refuses to compile because ā€œi may not have been assigned toā€. What do I gain? If I try using it without assignment, I’m STILL going to get a NullPointerException; the only difference is that now I’ve had to write extra code…Sigh.

[quote]There are damn fine reasons not to have operator overloading (and, of course, good reasons for having it - although I’ve been convinced over the years that the former outweigh the latter).

…but if you’ve got a really good reason for having it, then illuminate us (unless you were just trolling )
[/quote]
I’m not trying to troll here. I’ve just always found > or < more intuitive than a.compareTo(b). For instance, I’m implementing the storage of the map in a rts game as a sparse matrix. Since the elements are sorted in each LinkedList, it would be more intuitive to have > or <. But no, no troll here. I love Java. I’m not going back to C++. :smiley:

The solution to the problem with

f = f*Math.sqrt(f)

would be the addition of a full set of Math methods taking (and returning) float values. I gather this was omitted due to a defficiency in an early compiler (couldn’t overload on float/double). There ought to be an RFE for this, but I can’t find one.

As for operator overloading I think the only group with an undeniably strong claim are those using complex numbers and similar numerical types.