I need to integrate a scala library for reinforcement learning that works on scala 2.9.1 with a 2D game library. If it uses SBT that would be awesome.
I was looking at scage, however the current master branch is broken, it works on maven, and the examples for how to set up a starter project simply did not work.
I am not opposed to using a java library directly, but I really want to mimize the amount of work needed to get started.
Any suggestions?
How about ScalaFX?
At GitHub
JavaFX and Scala like milk and cookies
Related
I have a small project which uses Scala, Akka and Play combined. The way I set it up is the old-school way: download everything and link. I would like instead to mavenize the whole thing. Could you recommend me a clear, specific guide to do this? Thanks in advance.
Don't use Maven - use SBT - it's the build tool of choice.
Note maven is now squarely in the thoughtworks radar Hold section meaning nobody should be building new projects on it if you trust Fowler's advice: http://www.thoughtworks.com/radar
Play comes with sbt under the hood already so you shouldn't have to look to far from where you are now:
http://www.playframework.com/documentation/2.0/Build
I would like to use Scala and JMonkey Engine to create a small game. It should be nothing more than a test wether the engine is fun to use. I'm new to JMonkey and therefore don't know the usual method calls. Something like autocompletion would be nice but currently even the standard Scala autocompletion doesn's work. I downloaded JMonkey Engine, installed the standard Netbeans Scala Plugins. Now I can create Scala objects and classes but nothing more. Can you give me advice ?
Do you have really the latest version of the Scala Plugin? It seems to work (at least for me).
Just in case (it is a little bit hard to find):
For Scala 2.8: http://plugins.netbeans.org/plugin/36598/nbscala-2-8-x
For Scala 2.9: http://plugins.netbeans.org/plugin/38999/nbscala-2-9-x-0-9
BTW, there is a Scala 3D Engine (but still pretty alpha): Sgine
I'm tring to embed scalate in my website with sbt+jrebel, but found there are some problems I can't resolve.
So I want to know if there any other template engines based on scala?
How about popping on the Scalate group and describing the actual problems you're having? Am sure its fairly straight forward to work around? If the issue you're having is to do with sbt + jrebel and class reloading of scala code that you want to use inside your template engine; switching template engine's isn't sounding like an option (unless you want to stop using Scala in your templates). Plus Scalate is really the best and most popular template engine that uses Scala expressions inside it.
Play framework for scala has a brand new scala template engine
not sure if it can be used outside of play
http://scala.playframework.org/documentation/scala-0.9.1/templates
Pure Scala DSLs:
scala-xml (not sure how long this will be supported though)
ScalaTags
"Regular" templating engines:
Twirl
JSP (Java)
Freemarker (Java)
Velocity (Java)
Thymeleaf (Java)
Mustache.java (Java)
Thanks to String Interpolation from Scala 2.10, now we can use native syntax to generated a complex text content.
Just use Fastring. It has both good performance and simple usage.
If you're running on the JVM, Scala's interoperability with Java would let you use Velocity or Freemarker.
I might want to look at Stitchr which was largely inspired by StringTemplate
Scalasti is a Scala wrapper around StringTemplate.
As already mentioned above, I would recommend using Twirl (the template system from Play). It's now very easy to use standalone. You'll have compile time checking of your templates and many more cool and simple stuff:
https://github.com/spray/twirl
Do scala has a wrapper similar to http://antwrap.rubyforge.org/. I understand it would be quick easy to call ant methods directly from the REPL of as a script but was wondering if there is a DSL or wrapper around ant?
I think SBT is what yo are looking for essentially. It uses Scala 2.7 syntax but most of the time you barely need to write any script at all as long as you stick to a directory structure. It uses Ant and Ivy underneath and has excellent integration with Ant+Ivy and Maven based projects. You should definitely check it out. It's super easy to get started.
Update:
So I didn't read closely enough of the question it seems. I believe Gradle can do what you want. Gradle also has a Scala plugin. The downside is that this requires learning yet another language just to be able to write a build script. In the end you'll be using Groovy to write a Gradle build script that invokes an Ant build.xml that calls into Java to build a Scala project for you. This sounds like a lot of work.
BTW, you always have the choice to use JRuby and antwrap together. I don't want to know how slow this will be though.
As far as I have checked: No, there isn't.
Most people seem to use SBT, which has a slightly different feature set, but does an excellent job at building/running/deploying/testing/packaging.
I've been reading up on Scala a lot recently and I really want to get into it. I do my Java web development from within Eclipse with Tomcat as my preferred server and I'd like to keep it that way. I've tried the Scala Eclipse plugin but it's safe to say, it isn't there yet. I had to uninstall it because it simply ins't working. On top of that, it doesn't seem to provide anything for doing web projects (I could be wrong there).
Since Scala is a compiled language just like Java is, I was wondering if it's possible to simply swap out Java with Scala, as in, where I'd normally would create Java classes I would now be able to create Scala classes instead? Maybe even mix Java and Scala?
Is there anyone out there who's been able to set up a decent Scala workflow in Eclipse for web development without the dreaded "official" Scala Eclipse Plugin?
PS: I've tried the Play framework (I think it recently added Scala support) but it simply isn't for me. I like my classes compiled and to use JSP's for my views.
You don't say anything about what version of the Scala IDE for Eclipse you were using, or what you tried to do to resolve your issues. I suggest that before changing your workflow you head over to http://groups.google.com/group/scala-ide-user and see if we can help you out.
Since Scala is a compiled language
just like Java is, I was wondering if
it's possible to simply swap out Java
with Scala, as in, where I'd normally
would create Java classes I would now
be able to create Scala classes
instead?
Yes, absolutely. That's one of Scala's big advantages over some other JVM languages.
Maybe even mix Java and Scala?
Yes, absolutely. That's one of Scala's big advantages over some other JVM languages.
Make sure you have familiarity with the Java and Scala collections libraries (and that you keep them straight -- if you're planning using advanced Scala features on Java collections, definitely use a Scala 2.8 release candidate). Also make sure you're faimilar with the #BeanProperty annotation -- it can simplify your Scala coding somewhat.
As Miles said, you should give us the version of Eclipse you are working with.
I'm also new to Scala and found difficult to work through Eclipse. I was using Eclipse Galileo 3.5.2 and found specially long to compile all the scala libraries. I switched to IntelliJ (IDEA 9.0.2) and I'm much more confortable now. I recomend trying it although it's more a personal matter.
Even so, I agree, the plugins are not there yet specially for web development. The great news is that you can use everything you have in Java and mix it with Scala. Since Scala is compiled to Java BitCode, they are totally compatible. See Combining Scala and Java.
When writing in Scala you always have (almost) all the Java libraries at your service plus anything you have created before. You will have to be carefull with the types (i.e. primitive types) but it normally works out very well.