Jump to content

Recommended Posts

I think a major reason for choosing Java over other languages is there are no other interpreters with the stability and maturity of the JVM. I suspect BIS wants to move away from maintaining their own compiler/interpreter and some project on SourceForge isn't going to cut it for them, they need an industrial strength solution. The only other serious contender would be Lua (and maybe C#), and I am actually a little surprised BIS didn't opt for Lua.

in Java for example you can download a class from "somewhere" and execute arbitrary code ( through ClassLoader). As far as i know this can't be done in C++.

But a Java application can also use a SecurityManager to specify exactly what an application is allowed to do, down to what methods the code can call on various classes). So an application could be configured not to allow arbitrary code to be downloaded either by restricting access to the ClassLoader or by restricting access to classes in java.net. Or code could only be allowed to download from specific URLs, or arbitrary code could be downloaded and executed, but the downloaded code would be denied access to system resources (files, sockets, etc) and only be allowed to call specific methods of some API. I have no idea if BIS will make use of the Security features, but they are there if needed.

I just wish we could starting playing with the beta patch. This waiting is killing me.

Share this post


Link to post
Share on other sites

I have not got around to learning the scripting language of OFP, ArmA, or Take On Helicopters (Except basic things like addWeapon), nor have I ever learned Java.

But I did play around with Ruby, which I really liked because it was so simple.

Edited by Nicholas

Share this post


Link to post
Share on other sites

Although I am looking forward to this release, I am slightly worried that the editing forums are going to be a mish mash of code snippets from all kinds of languages! At least previously it was either sqf or sqs!

Are we going to have;

Editing forum : Lua

Editing forum : Ruby

Editing forum : Java

Editing forum : visual COBOL

so on and so forth or will there be forum standards to put code snippets in a particular form.

Although this is somewhat 'tongue-in-cheek', it could get messy.

Edited by Jedra

Share this post


Link to post
Share on other sites
Although I am looking forward to this release, I am slightly worried that the editing forums are going to be a mish mash of code snippets from all kinds of languages! At least previously it was either sqf or sqs!

Are we going to have;

Editing forum : Lua

Editing forum : Ruby

Editing forum : Java

Editing forum : visual COBOL

so on and so forth or will there be forum standards to put code snippets in a particular forum.

Although this is somewhat 'tongue-in-cheek', it could get messy.

Yea, I have some worries about this too... :p

Share this post


Link to post
Share on other sites

I'm sure if people tag there questions it won't be big mess for TOH [language] question ?

When arma 3 is out well probably diff story :)

Share this post


Link to post
Share on other sites
I'm sure if people tag there questions it won't be big mess for TOH [language] question ?

When arma 3 is out well probably diff story :)

I am not necessarily talking about working out what language an answer is in. Currently if you ask a 'How Do I?' question, the answer is mostly as a sqf. With many different languages, you're going to get multiple answers! Also by having multiple languages, the pool of experts might be smaller than it would be normally.

I suppose an answer would be to post the Java that these languages create before it heads off to be crunched by the JVM, but some of that stuff is not exactly human readable!

I guess on the plus side, we'll all become multi-lingual in Java languages.

These are merely observations - I am chomping at the bit to play with this!!!!

Share this post


Link to post
Share on other sites

I have no doubt that once I start posting Groovy snippets everyone will see the light and jump on the Groovy bandwagon ;)

However, I suspect most people will stick with plain old Java, and the rest will settle on one or two languages that are the easiest to work with. For example, while there are many languages that run on the JVM not all of them compile to Java bytecode. Similarly other languages, like JRuby, require extra statements to be added to the code to generate normal Java .class files, so writing a JRuby module that plays nicely with other modules in the JVM is more work than the same module written in Groovy.

More than a common JVM language, I hope that the community settles on a common build and dependency management system. I myself prefer Apache Maven and think that would be the easiest for non-programmers to use. I wouldn't recommend Ant to my worst enemy and it is certainly not something new programmers trying to script a mission should need to learn. The biggest benefit to Maven (and it is huge) is its dependency management system which makes it trivial to reuse, share, and distribute Java modules. If a person has developed a module and deployed it to a Maven repositories other people only need to add a few lines to a config file to use that module; Maven will download the module, other modules it depends on, and any related documentation. Then there are things like Gradle which combines Ant and Maven into a single build system.

Maybe someone at BIS could tell us what they are using to build their Java code? Do you use Maven? Would BIS consider hosting a Maven repository? Setting up a Maven repository is relatively trivial.

Share this post


Link to post
Share on other sites

Yeah gonna be a big mess if everyone comes with one over langage for mod and other script :rolleyes:

Still don't know if BIS going to deliver the ArmA 3 Java API as libraries and not simply javaDoc. Moreover as the API will wrap the native Engine (C++) certainly trough JNI, means that we must have native libraries (dll) if we want to run/debug Java into Eclipse and others ^^

Share this post


Link to post
Share on other sites

i could not resist.

Mk3qkQROb_k

Java, Lua and Ruby are some of the contenders (just note that in-house we test Java only so far).

i demand that Python to be considerd too :D

Share this post


Link to post
Share on other sites
Java and C# programs use garbage collector of their virtual machine which made development ton of easier and safer compare to C++ (memory access violation, buffer overflow etc). Moreover C++ has few security aspects compare Java. What about for a given addon running malicious code while you are playing ArmA 3 :D:rolleyes:

Also C++ is also a statically compiled language, which means you would have to create a DLL which the game would have to pipe in. As DLL authoring is fairly advanced, and full of traps for the unwary (http://en.wikipedia.org/wiki/DLL_Hell), its not really the kind of thing you would want to use as a scripting language.

You could of course write an interpreter for C++ so it could run as a scripting language ... but it would be a mildly insane thing to do. (although somebody has done it ... http://www.softintegration.com/)

Editing forum : visual COBOL

:rofl:

Edited by A.R.Mageddon

Share this post


Link to post
Share on other sites
Also C++ is also a statically compiled language, which means you would have to create a DLL which the game would have to pipe in. As DLL authoring is fairly advanced, and full of traps for the unwary (http://en.wikipedia.org/wiki/DLL_Hell), its not really the kind of thing you would want to use as a scripting language.

"particularly legacy 16-bit editions which all run in a single memory space"...

It's nearly 20 years ago that Microsoft introduced Windows '95, 32-bit OS :-) And I think post 2000 the issue is fairly non existent?

:rofl:

Share this post


Link to post
Share on other sites
"particularly legacy 16-bit editions which all run in a single memory space"...

It's nearly 20 years ago that Microsoft introduced Windows '95, 32-bit OS :-)

Well you would have thought so wouldn't you ... I mean it seems reasonable to assume that in 20 years Microsoft might be able to fix fundamental flaws. But like bad landlords, a lick of paint and a quick makeover can hide a multitude of sins ...

http://blogs.isosoftsol.com/post/2009/12/21/Side-by-Side-%28SxS%29-DLLs-Manifests-and-Windows-7.aspx

And I think post 2000 the issue is fairly non existent?

Would that it were so ... but M$ have decided that retro is cool ...

http://drdobbs.com/cpp/227300037

As I said .... C++ is a very deep and complicated language, and most definitely not something you would really want to use for scripting. ;)

For the record Serclaes ... Java is also a very deep and complicated language, like C++ (and fine wines), its had time to mature ... and sometimes that maturity comes at a cost (like fine wines).

Edited by A.R.Mageddon

Share this post


Link to post
Share on other sites
Was a few months away from the forums, came back, found this thread about JVM, doubled checked I'm not on stackoverflow. Wtf, I'm in a game forum and they're talking about the JVM? :eek:

Nah, if this was Stack Overflow, they'd be talking about how Haskell is the ultimate language, and anybody who doesn't learn it is a peon who doesn't understand real programming. Personally, I think Haskell is a toy language and that nothing particularly useful is going to come out of it, but I've got a vendetta against most pure functional languages. Java, on the other hand, is just fine by me!

Share this post


Link to post
Share on other sites

Aww man, and I'm at work.

Quick, someone do some performance tests against SQF. :p

Share this post


Link to post
Share on other sites

Cool. Haven't done Java in years...

Only issue I had with sample mission was switching back to Eclipse at debug breakpoint. (Alt-Tab didn't work, had to use some ctrl-shift-esc and ctrl-alt-del magic)

Running game in windowed mode helped a lot. :)

Share this post


Link to post
Share on other sites

Nice :yay:

Got it almost fully working. I think this is my problem:

> make sure the project (and JNIScripting.jar) are listed under the Source tab in the debug configuration

If someone could add picture to the guide, it would help tremendously to figure it out more quickly:

http://community.bistudio.com/wiki/Java_Scripting

Also to offer an existing project for download to move into the editor missions folder and adjust it might be easier.

Is there a way to generate JavaDoc for the existing RVEngine commands?

Or will you provide it as download? Cheers. :bounce3:

Edited by .kju [PvPscene]

Share this post


Link to post
Share on other sites
Is there a way to generate JavaDoc for the existing RVEngine commands?

There will be, but this functionality is currently broken.

Share this post


Link to post
Share on other sites

Great job! Out of curiosity, why exactly do we have to remove the Object as parent class. Iirc every class is extended from object anyway? Oo

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×