State of Scala and PlayN?

160 views
Skip to first unread message

mle...@gmail.com

unread,
Feb 18, 2012, 4:32:53 PM2/18/12
to pl...@googlegroups.com
I found this build file http://code.google.com/p/playn/source/browse/project/Build.scala?r=7fdc0e501fdeb751e6b35cf9383c640fd8720b20 . However, I haven't found any documentation even mentioning the use of Scala with PlayN. Does scala now work? Has anyone tried to use it?
Thanks,
Matt

Michael Bayne

unread,
Feb 19, 2012, 1:44:21 PM2/19/12
to pl...@googlegroups.com

That's just an SBT build for the PlayN Java code. It doesn't actually
involve any Scala (other than the Scala used to control SBT).

Using PlayN with Scala is fine as long as you're willing to give up
the HTML5 (and non-functional Flash) backend(s). The JVM, Android and
iOS backends deploy to targets via Java bytecode, not Java source
code, so they don't care or notice if the bytecodes from from the
Scala compiler rather than the Java compiler.

There are pitfalls that one easily encounters when using Scala on
Android (particularly Scala 2.9+), generally due to Scala being
profligate with class and interface generation and Android not
expecting such profligacy, so don't assume that Scala+PlayN will be a
walk in the park.

-- m...@samskivert.com

Michael Bayne

unread,
Feb 19, 2012, 1:49:43 PM2/19/12
to pl...@googlegroups.com
On Sun, Feb 19, 2012 at 10:44 AM, Michael Bayne <m...@samskivert.com> wrote:
> Using PlayN with Scala is fine as long as you're willing to give up
> the HTML5 (and non-functional Flash) backend(s).

I should also mention that if you have a very high tolerance for
bleedy edges, there is the Scala+GWT project
(https://github.com/scalagwt) which pretty much has Scala compilable
via GWT. But it's extremely alpha, and unless you're a Scala compiler
hacker, you're probably going to run into inscrutable rough edges.

-- m...@samskivert.com

mle...@gmail.com

unread,
Feb 19, 2012, 6:03:04 PM2/19/12
to pl...@googlegroups.com
Thanks, that was very helpful. I know this is not exactly and Android or Scala forum, but off the top of your head, do you know if 2.8 has markedly better performance on Android's Dalvik?

Michael Bayne

unread,
Feb 20, 2012, 10:41:46 AM2/20/12
to pl...@googlegroups.com
On Sun, Feb 19, 2012 at 3:03 PM, <mle...@gmail.com> wrote:
> I know this is not exactly and Android or Scala forum, but off the top of
> your head, do you know if 2.8 has markedly better performance on Android's
> Dalvik?

AFAIK not a lot of work has been done to specifically improve
performance on Dalvik. A few changes have been made to reduce the
classfile explosion that often accompanies Scala code, which helps
when targeting Dalvik, but other than that I don't know of any direct
efforts along those lines.

There have been discussions on the Scala mailing list in the last few
months where some people say they're happily using Scala on Android
and others say that the 2.9 series is completely unusable (mostly due
to classfile size, not speed). One would have to try for themselves to
determine their own opinion.

-- m...@samskivert.com

Daniel Gerson

unread,
May 20, 2014, 6:18:12 AM5/20/14
to pl...@googlegroups.com
Anyone tried this more recently than was last mentioned here?


Seems their demos have come a long way, and they support something called Jribble which makes it sound like scala+gwt will support java as well?

I'm only marginally asking about this in a PlayN context.. but more from a general webapp... Also given there are solutions like Robovm and Emscripten that may be a better route to achieve the same thing?

Was actually more just planning to hack something for the web in scala, and wanted to know what was possible/what others have tried/and what would be fruitful.
People here seem to have a lot of experience with these things :-)

Thanx

Michael Bayne

unread,
May 20, 2014, 9:36:52 AM5/20/14
to pl...@googlegroups.com
On Tue, May 20, 2014 at 3:18 AM, Daniel Gerson <daniel...@gmail.com> wrote:
Anyone tried this more recently than was last mentioned here?


Seems their demos have come a long way, and they support something called Jribble which makes it sound like scala+gwt will support java as well?

I don't think anyone has done any work on Scala GWT in at least two years. The main guy that was working on it went to work on the Scala compiler and he's never really looked back.

I'm only marginally asking about this in a PlayN context.. but more from a general webapp... Also given there are solutions like Robovm and Emscripten that may be a better route to achieve the same thing?

There's a new, much simpler, project for compiling Scala to JavaScript, which has made great progress in the last six months or so: http://www.scala-js.org/

If you want to do web stuff in Scala, that's the way to go.

-- m...@samskivert.com

Daniel Gerson

unread,
May 20, 2014, 9:48:30 AM5/20/14
to pl...@googlegroups.com

I'm only marginally asking about this in a PlayN context.. but more from a general webapp... Also given there are solutions like Robovm and Emscripten that may be a better route to achieve the same thing?

There's a new, much simpler, project for compiling Scala to JavaScript, which has made great progress in the last six months or so: http://www.scala-js.org/

If you want to do web stuff in Scala, that's the way to go.

Thanx! That's exactly the kind of thing I wanted to know. Much obliged. 
Reply all
Reply to author
Forward
0 new messages