4

My scala application needs to perform simple operations over large arrays of integers & doubles, and performance is a bottleneck. I've struggled to put my finger on exactly when certain optimizations kick in (e.g. escape analysis) although I can observe their results through various benchmarking. I'd love to do some AOT compilation of my scala application, so I can see or enforce (or implement) certain optimizations ... or compile to native code, if possible, so I can cut corners like bounds checking and observe if it makes a difference.

My question: what alternative compilation methods work for scala? I'm interested in tools like llvm, vmkit, soot, gcj, etc. Who is using those successfully with scala at this point, or are none of these methods currently compatible or maintained?

rolve
  • 9,021
  • 4
  • 50
  • 70
Josh Marcus
  • 1,749
  • 17
  • 27
  • 3
    I'm almost sure there is no alternative backend for Scala except for the JVM. An experimental LLVM backend (http://greedy.github.com/scala/scalallvm.pdf) exists but is not ready for production. – nimrodm Jun 15 '11 at 20:00

2 Answers2

2

To answer my own question, there is no alternative backend for Scala except for the JVM. The .NET backend has been in development for a long time, but its status is unclear. The LLVM backend is also not yet ready for use, and it's not clear what its future is.

Josh Marcus
  • 1,749
  • 17
  • 27
2

GCJ can compile JVM classes to native code. This blog describes tests done with Scala code: http://lampblogs.epfl.ch/b2evolution/blogs/index.php/2006/10/02/scala_goes_native_almost?blog=7

thoredge
  • 11,158
  • 1
  • 34
  • 50
  • This answer doesn't answer my question. GCJ is a largely abandoned project, and the blog you've referenced has specially built scala main libraries with functionality stripped out, and was based on an old version of scala. – Josh Marcus Jul 13 '11 at 22:48