Support for Scala

Hi,
I need 3d graphics for my next project and jmonkey seems perfect. The only thing I need to know is:

How is its Scala support ?

Is it possible to develop JMonkey using the Scala IDE ? Will there be useful autocompletion ? Do you know any problems, I may encounter ?
About a year ago, I looked at jmonkey for the first time and it was basically a highly customized Netbeans IDE. In order to use a good Scala plugin it was necessary to run both the jmonkey IDE as well as Eclipse and sync the files between a Scala project in Eclipse and jmonkey. I don’t remember the specifics, but it wasn’t exactly efficient. No offense meant, I really appreciate the great work you’ve done. Maybe I just didn’t do it the right way.

Will I be productive with Scala and jmonkey ?

jmonkey platform is a superset of netbeans ide which has working scala support plug-in. i think scala should work fine, but you’d probably still be using it alongside java code.

JME is a java 3D engine.
There are plenty of pitfalls you may fall into during game development and adding another language overlay is not the wisest thing to do IMO.

May I ask why you want to use Scala?

@nehon There are many reasons why I’d want to use Scala and it’s hard to find the one killer argument for it. I really enjoy the functional aspects of Scala, moreover it has fantastic collection classes. And its multithreading is just perfect.

As far as I know you can use Java libraries from Scala. So there should be no problem using the JME API in Scala?

Yeah, jme is a java library and is documented, scala has java support. The rest is your part.

@nordländer said There are many reasons why I’d want to use Scala and it’s hard to find the one killer argument for it. I really enjoy the functional aspects of Scala, moreover it has fantastic collection classes. And its multithreading is just perfect.

Yeah I understand, but you will probably run into other issues that will nil this advantages.
I mean, afaik no one tested it yet…so there might be issues…and you’ll be the first to run into them, so it’s gonna be hard to find some help.
I don’t know, to me it sounds like it doesn’t worth the risk.

I may give some useful input. I have been using JME3 w/ Scala for a year now. My setup is the latest Eclipse + Scala IDE + JME3 nighties. The nighties are recommended to use in case if you want the JME3 as a library, without the SDK. I have found the engine to be totally enjoyable to use w/ Scala - you get all the FP bonus, that is, and no issues at all. Two main inconviniences that I have came across are: 1) to instantiate JME3 classes, you have to use the “new” keyword, there are no innate companion objects and 2) In some rare occasions you have to deal with Java collections instead of Scala collections, or at least, transform them to Scala equivalents. While working with the engine I have even built a framework on top of it, which hides Javaish features in favor of the comfort. So, I understand what means “Scala” for someone who tried it, and I would say that imho there is no reason why should not you experiment. And, surely, anyway, you can use the mix of Java+Scala code in any Scala project, in case if for some reason you would like to implement some part of your code in pure Java… but that never happened to me :smiley:

Surely, you lose all the convinience and plugins provided by the SDK, but in my experience I have never used them, the plain code was always enough (your experience may differ!!!). I figured that if I would need these conviniences, I could use the SDK to generate the files and then add them to the project.

And as a note - at first I was trying to integrate Scala with the NetBeans platform of the SDK, installing plugins and stuff. After getting a strong headache trying to make the Scala compiler work with the SDK projects, I have abandoned the idea, switching to Scala IDE and JME3 nighties instead. But that was a year ago… things might have changed… If you get any luck with this, please let me know :slight_smile:

7 Likes

That’s very valuable input @noncom thanks!
Looks like someone did test it :stuck_out_tongue:
The SDK is now based on Netbeans 7.2, so maybe things changed on this side.

1 Like

I can confirm that the engine runs flawlessly under jruby as well. I was quite surprised by the performance I got! =) I plan to do further experimentation with jruby to see were the limits are =)

2 Likes

I am using ‘Scala’ for my JME project. I can’t say there have been any surprises … other than it all seemed to go fairly smoothly! :o)

@andre said: I am using 'Scala' for my JME project. I can't say there have been any surprises ... other than it all seemed to go fairly smoothly! :o)
Cool! Any particular experiences or proof of progress to share? (better start a new thread for the latter though).

Well, I use Eclipse because I find the jMonkey’s Netbeans IDE too slow. Then you add the Scala IDE plugin. Scala compiles to .class files.
Converting a few lines of Java to Scala is pretty painless. There’s less boilerplate code. Frame rate is fine. Its just like using Java, but without Java.