JDK 1.5 features

Started by
16 comments, last by thwart 18 years, 7 months ago
Considering the addition of 'Annotations' along with the other new features of Java 1.5, has anyone considered Java to be a more viable scripting language than it has before? I've been working with it for a few weeks and I am finding it to be a good fit. [Edited by - thwart on August 19, 2005 9:32:36 AM]
Advertisement
No responses? Wow.
I don't see annotations as being particularly useful for scripting purposes. Really I don't consider Java to be high level enough to be worth using for scripting, given the VM overhead. For a similar amount of work I could use Python instead.
I think java is better for applets and applications. You probably could pull it off, but it isn't meant to be a scripting language. For scripting, I would pick Python. It is a smaller language but has a great feature set. It is beginner friendly and it's free. Although, I would say use whatever best fits your app needs/coding style.
You're right SKATIN_HARD, it's not a scripting language, but it can be embedded into a c++ application. It can also call C++ code.

Tim Sweeney, from Epic, looked at embedding Java as a scripting language back when he was first designing the Unreal Engine, but at the time the feature set was limited. I'm curious if the features in Java 1.5, make Java a better candidate for embedding.

A lot of people think that a scripting language means that it doesn't get compiled. To me, a scripting language separates the low-level engine from the game logic. If you can compile the scripting language into byte code at design-time or at the beginning of run-time that is even better! Having a compiler to check the code for errors is a good thing too!

One of the things that intregues me about Java is the syntax. Same goes for C#. These languages are, of course, similar to C++. I don't like Visual Basic-like syntax, but I like many others have had to write my share of VB and VB.Net code. Blech!!! I've used both the Java and C# languages extensively; however Java is cross-platform (C# is too, kind of, but not enough for me). Platform compatibility may be a little more limited, when JNI (Java Native Interface) comes into play, because JNI may not be completely implemented on all Java platforms.

So this is why I have begun embedding Java 1.5 into my engine. I'll give an update on my progress as more and more of the Java code gets written. Once I have enough of the C++ and Java code written and tested I will post here again to give an update on how it is working out.
I think the key aspect of a useful scripting language is the ability to quickly and easily modify the code. Java's syntax simply doesn't lend itself well to this. It's better than, for example, C++, but that's not saying much.

edit: grammar

[Edited by - SiCrane on August 25, 2005 2:31:40 PM]
Ooh. One more thing. The fact that there are so many people out there that think that Java is used for mainly Applets just kills me! Sure Java can be used to make client-side applets on the web and full-blown applications; but it's biggest use is by far in the Enterprise arena. I'm talking about server-side code on a web server or middle-tier server. A large percentage of web sites and web services are built with Java. Heck, you can use Java in the database layer if you use Oracle. Java can do anything that DotNet can do. Both language platforms are an excellent choice in the Enterprise. Both have source code available in open source repositories -- Java has more, but DotNet is probably getting pretty close by now.

I know this particular reply to this post is a little off topic, but I want to make sure that all developers are aware that Java is one of the most used language platforms in the world. Everything from rinky-dink little applets to full-scale Enterprise applications are being written in Java all over the world.

Weeeeeeeeeeeeeeeeeeeeeeee!
SiCrane: If Unreal Script can use that kind of syntax why can't Java?
Unreal Script compiles to byte-code at run-time and the syntax is virtually the same.

Unreal Script is geared more toward games than Java is, but Sweeney hasn't released a standalone compiler and run-time that could be used for free in our own games. You need the entire Unreal Engine and a costly license. I wonder if Epic ever submitted the language specification to a standards body?
Syntax virtually the same, we are talking about the same two languages, right? UnrealScript may be based on Java, but the structure is significantly simpler. Lack of need to put class functions inside of the curly braces, lack of case sensitivity, straightforward state implementations, implicit seperate threads of execution; these are all features that make UnrealScript much more suitable to scripting than vanilla Java.

This topic is closed to new replies.

Advertisement